public class

Country

extends AbstractExtension
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.extensions.Country

Class Overview

The country name.

Summary

Constants
String CODE XML "code" attribute name
String XML_NAME XML element name
Fields
private String code The 3166-1 alpha-2 country code
private String value Value
[Expand]
Inherited Fields
From class com.google.gdata.data.AbstractExtension
Public Constructors
Country()
Default mutable constructor.
Country(String code, String value)
Immutable constructor.
Public Methods
boolean equals(Object obj)
String getCode()
Returns the The 3166-1 alpha-2 country code.
static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
Returns the extension description, specifying whether it is required, and whether it is repeatable.
String getValue()
Returns the value.
boolean hasCode()
Returns whether it has the The 3166-1 alpha-2 country code.
boolean hasValue()
Returns whether it has the value.
int hashCode()
void setCode(String code)
Sets the The 3166-1 alpha-2 country code.
void setValue(String value)
Sets the value.
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String CODE

XML "code" attribute name

Constant Value: "code"

static final String XML_NAME

XML element name

Constant Value: "country"

Fields

private String code

The 3166-1 alpha-2 country code

private String value

Value

Public Constructors

public Country ()

Default mutable constructor.

public Country (String code, String value)

Immutable constructor.

Parameters
code The 3166-1 alpha-2 country code.
value Value.

Public Methods

public boolean equals (Object obj)

Parameters
obj

public String getCode ()

Returns the The 3166-1 alpha-2 country code.

Returns
  • The 3166-1 alpha-2 country code

public static ExtensionDescription getDefaultDescription (boolean required, boolean repeatable)

Returns the extension description, specifying whether it is required, and whether it is repeatable.

Parameters
required Whether it is required
repeatable Whether it is repeatable
Returns
  • extension description

public String getValue ()

Returns the value.

Returns
  • value

public boolean hasCode ()

Returns whether it has the The 3166-1 alpha-2 country code.

Returns
  • whether it has the The 3166-1 alpha-2 country code

public boolean hasValue ()

Returns whether it has the value.

Returns
  • whether it has the value

public int hashCode ()

public void setCode (String code)

Sets the The 3166-1 alpha-2 country code.

Parameters
code The 3166-1 alpha-2 country code or null to reset

public void setValue (String value)

Sets the value.

Parameters
value Value or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.