com.google.gdata.data.webmastertools
Class DomainPreferenceConstruct
java.lang.Object
com.google.gdata.data.AbstractExtension
com.google.gdata.data.ValueConstruct
com.google.gdata.data.EnumConstruct
com.google.gdata.data.webmastertools.DomainPreferenceConstruct
- All Implemented Interfaces:
- Extension
- Direct Known Subclasses:
- SitesEntry.PreferredDomain
public abstract class DomainPreferenceConstruct
- extends EnumConstruct
GData schema extension describing a node with a domain preference.
The domain preference is a value in preferwww, prefernowww, none
.
This class is abstract, subclasses must define a default constructor
which has the node name hardcoded. See EnumConstruct
.
Methods inherited from class com.google.gdata.data.AbstractExtension |
eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
DomainPreferenceConstruct
public DomainPreferenceConstruct(java.lang.String nodeName)
- Constructs
EnumConstruct
to represent the preference setting.
equals
public boolean equals(java.lang.Object rhs)
- Compares
DomainPreferenceConstruct
objects based on the
domain preference that they they hold.
- Overrides:
equals
in class ValueConstruct
hashCode
public int hashCode()
- Returns a hash code which is based on the preference string.
- Overrides:
hashCode
in class ValueConstruct
setValue
public void setValue(java.lang.String value)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
- Override
EnumConstruct.setValue(String)
to validate that
the supplied value is a one of the accepted domain preferences.
See DomainPreference
.
- Overrides:
setValue
in class EnumConstruct
- Parameters:
value
- new value for the value construct or null
to reset.
- Throws:
java.lang.NullPointerException
- if the value is null.
java.lang.IllegalArgumentException
- if value is not a valid domain
preference none, preferwww, prefernowww
.
setPreference
public void setPreference(DomainPreference value)
getPreference
public DomainPreference getPreference()