Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/input/DateTimeSuggestion.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/DateTimeSuggestion.java b/content/public/android/java/src/org/chromium/content/browser/input/DateTimeSuggestion.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f922a2549381c52c34f18ac4e435b70c9e42a142 |
| --- /dev/null |
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/DateTimeSuggestion.java |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.content.browser.input; |
| + |
| +/** |
| + * Date/time suggestion container used to store information for each suggestion that will be shown |
| + * in the suggestion list dialog. Keep in sync with date_time_suggestion.h. |
| + */ |
| +public class DateTimeSuggestion { |
|
bulach
2013/12/03 14:22:29
nit: can this be package private?
keishi
2013/12/03 16:52:34
Done.
|
| + public final double value; |
|
bulach
2013/12/03 14:22:29
nit: I think we normally use private fields and ge
keishi
2013/12/03 16:52:34
Done.
|
| + public final String localizedValue; |
| + public final String label; |
| + |
| + /** |
| + * Constructs a color suggestion container. |
| + * @param value The suggested date/time value. |
| + * @param localizedValue The suggested value localized. |
| + * @param label The label for the suggestion. |
| + */ |
| + public DateTimeSuggestion(double value, String localizedValue, String label) { |
| + this.value = value; |
| + this.localizedValue = localizedValue; |
| + this.label = label; |
| + } |
| + |
| + @Override |
| + public boolean equals(Object object) { |
| + if (!(object instanceof DateTimeSuggestion)) { |
| + return false; |
| + } |
| + final DateTimeSuggestion other = (DateTimeSuggestion) object; |
| + return value == other.value && |
| + localizedValue == other.localizedValue && |
| + label == other.label; |
| + } |
| + |
| + @Override |
| + public int hashCode() { |
| + int hash = 31; |
| + hash = 37 * hash + (int) value; |
| + hash = 37 * hash + localizedValue.hashCode(); |
| + hash = 37 * hash + label.hashCode(); |
| + return hash; |
| + } |
| +} |