@Immutable
public class Attribute
extends java.lang.Object
Product
.Modifier and Type | Class and Description |
---|---|
static class |
Attribute.Enum
The value of a custom enum attribute.
|
Modifier and Type | Field and Description |
---|---|
static LocalizedString |
defaultLocalizedString |
Constructor and Description |
---|
Attribute(java.lang.String name,
java.lang.Object value) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
com.google.common.base.Optional<java.lang.Boolean> |
getBoolean() |
org.joda.time.DateTime |
getDateTime()
If this is a DateTime attribute, returns the DateTime value.
|
double |
getDouble()
If this is a number attribute, returns the double value.
|
Attribute.Enum |
getEnum()
If this is an enum attribute, returns the value.
|
int |
getInt()
If this is a number attribute, returns the integer value.
|
LocalizableEnum |
getLocalizableEnum()
If this is a localized enum attribute, returns the localized enum value.
|
LocalizedString |
getLocalizedString()
If this is a localized string attribute, returns the localized string value.
|
Money |
getMoney()
If this is a money attribute, returns the money value.
|
java.lang.String |
getName()
Name of this custom attribute.
|
<T> com.google.common.collect.ImmutableSet<T> |
getSet(java.lang.Class<T> clazz) |
java.lang.String |
getString()
If this is a string attribute, returns the string value.
|
java.lang.Object |
getValue()
Value of this custom attribute.
|
int |
hashCode() |
java.lang.String |
toString() |
public static LocalizedString defaultLocalizedString
@Nonnull public java.lang.String getName()
public java.lang.Object getValue()
public com.google.common.base.Optional<java.lang.Boolean> getBoolean()
public java.lang.String getString()
public int getInt()
public double getDouble()
public Money getMoney()
public Attribute.Enum getEnum()
public LocalizedString getLocalizedString()
public LocalizableEnum getLocalizableEnum()
public <T> com.google.common.collect.ImmutableSet<T> getSet(java.lang.Class<T> clazz)
public org.joda.time.DateTime getDateTime()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object