public class

GoogleBaseAttributesExtension

extends Object
implements Extension
java.lang.Object
   ↳ com.google.api.gbase.client.GoogleBaseAttributesExtension

Class Overview

Keeps track of attributes in the g: namespace. This class extends the Google data API with some knowledge about the g: (Google Base attributes) namespace. The attributes are stored in a list as GoogleBaseAttributes Accessing GoogleBaseAttribute directly is possible, but usually not recommended. Many methods are available in this class that will perform the necessary type conversion from GoogleBaseAttribute to String, Integer, Float, and DateTime. Shortcuts exist for a few well-known attributes. You usually get such an object using getGoogleBaseAttributes(). This class can be registered in an ExtensionProfile using DESCRIPTION and then accessed from an ExtensionPoint using getExtension(Class).

Summary

Constants
String APPLICATION_ATTRIBUTE Attribute <g:application>.
String CUSTOMER_ID Attribute <g:customer_id>.
String DELIVERY_NOTES_ATTRIBUTE Attribute <g:delivery_notes>.
String DELIVERY_RADIUS_ATTRIBUTE Attribute <g:delivery_radius>.
String EXPIRATION_DATE_ATTRIBUTE Attribute <g:expiration_date>.
String GM_ADJUSTED_NAME_ATTRIBUTE Meta attribute gm:adjusted_name.
String GM_ADJUSTED_VALUE_ATTRIBUTE Meta attribute gm:adjusted_value.
String GM_THUMBNAIL_ATTRIBUTE Meta attribute gm:thumbnail.
String IMAGE_LINK_ATTRIBUTE Attribute <g:image_link>.
String ITEM_TYPE_ATTRIBUTE Attribute <g:item_type>.
String LABEL_ATTRIBUTE Attribute <g:label>.
String LOCATION_ATTRIBUTE Attribute <g:location>.
String PAYMENT_METHOD_ATTRIBUTE Attribute <g:payment_accepted>.
String PAYMENT_NOTES_ATTRIBUTE Attribute <g:payment_notes>.
String PICKUP_ATTRIBUTE Attribute <g:pickup>.
String PRICE_ATTRIBUTE Attribute <g:price>.
String PRICE_TYPE_ATTRIBUTE Attribute <g:price_type>.
String PRICE_UNITS_ATTRIBUTE Attribute <g:price_units>.
String QUANTITY_ATTRIBUTE Attribute <g:quantity>.
String SHIPPING_ATTRIBUTE Attribute <g:shipping>.
String TAX_ATTRIBUTE Attribute <g:tax>.
String TAX_PERCENT_ATTRIBUTE This constant is deprecated. use TAX_ATTRIBUTE instead
String TAX_REGION_ATTRIBUTE This constant is deprecated. use TAX_ATTRIBUTE instead
Fields
public static final ExtensionDescription DESCRIPTION A description for this extension, to pass to an ExtensionProfile.
private final List<GoogleBaseAttribute> attributes All the attributes available for the current ExtensionPoint in this extension namespace.
Public Constructors
GoogleBaseAttributesExtension()
Public Methods
GoogleBaseAttribute addAttribute(GoogleBaseAttribute attribute)
Adds an attribute to the list.
GoogleBaseAttribute addBooleanAttribute(String name, boolean value)
Adds an attribute of type BOOLEAN.
GoogleBaseAttribute addDateAttribute(String name, DateTime date)
Adds an attribute of type DATE.
GoogleBaseAttribute addDateTimeAttribute(String name, DateTime dateTime)
Adds an attribute of type DATE_TIME.
GoogleBaseAttribute addDateTimeRangeAttribute(String name, DateTimeRange dateTimeRange)
Adds an attribute of type DATE_TIME_RANGE.
GoogleBaseAttribute addFloatAttribute(String name, float value)
Adds an attribute of type FLOAT.
GoogleBaseAttribute addFloatUnitAttribute(String name, NumberUnit<Float> value)
Adds an attribute of type FLOAT_UNIT.
GoogleBaseAttribute addFloatUnitAttribute(String name, float value, String unit)
Adds an attribute of type FLOAT_UNIT.
void addGroupAttribute(String groupName, Group group)
Adds group attribute.
void addImageLink(String link)
Adds an image URL.
GoogleBaseAttribute addIntAttribute(String name, int value)
Adds an attribute of type INT.
GoogleBaseAttribute addIntUnitAttribute(String name, int value, String unit)
Adds an attribute of type INT_UNIT.
GoogleBaseAttribute addIntUnitAttribute(String name, NumberUnit<Integer> value)
Adds an attribute of type INT_UNIT.
void addLabel(String value)
Adds a label to the entry.
GoogleBaseAttribute addLocationAttribute(String name, Location location)
Adds an attribute of type LOCATION.
GoogleBaseAttribute addLocationAttribute(String name, String location)
Adds an attribute of type LOCATION.
GoogleBaseAttribute addNumberAttribute(String name, Number value)
Adds an attribute of type NUMBER.
GoogleBaseAttribute addNumberUnitAttribute(String name, NumberUnit<Number> value)
Adds an attribute of type NUMBER_UNIT.
GoogleBaseAttribute addNumberUnitAttribute(String name, Number value, String unit)
Adds an attribute of type NUMBER_UNIT.
void addPaymentMethod(String method)
Adds an accepted payment method.
GoogleBaseAttribute addReferenceAttribute(String name, String value)
Adds an attribute of type REFERENCE.
void addShipping(Shipping shipping)
Adds shipping attribute.
void addShippingAttribute(String name, Shipping shipping)
Adds an attribute of type SHIPPING.
void addTax(Tax tax)
Adds tax attribute.
void addTaxAttribute(String name, Tax tax)
Adds an attribute of type TAX.
GoogleBaseAttribute addTextAttribute(String name, String value)
Adds an attribute of type TEXT.
GoogleBaseAttribute addUrlAttribute(String name, String value)
Adds an attribute of type URL.
void clearAttributes()
Removes all attributes from the list.
void generate(XmlWriter xmlWriter, ExtensionProfile extensionProfile)
String getApplication()
Gets the application attribute.
GoogleBaseAttribute getAttribute(String name, GoogleBaseAttributeType type)
Gets the first attribute with a certain name and type.
GoogleBaseAttribute getAttribute(String name)
Gets the first attribute with a certain name.
List<? extends GoogleBaseAttribute> getAttributes(String name)
Gets all the attributes with a certain name and type.
List<? extends GoogleBaseAttribute> getAttributes(String name, GoogleBaseAttributeType type)
Gets all the attributes with a certain name and type.
List<? extends GoogleBaseAttribute> getAttributes()
Gets a list of all the attributes available in the extension namespace at the current ExtensionPoint.
Boolean getBooleanAttribute(String name)
Gets the first value of a specific attribute, as an Boolean.
Integer getCustomerId()
DateTime getDateAttribute(String name)
Gets the first value of a specific attribute, as a date.
DateTimeRange getDateRangeAttribute(String name)
Gets the first value of a specific attribute, as a date/dateTime range.
DateTime getDateTimeAttribute(String name)
Gets the first value of a specific attribute, as a date and a time.
DateTimeRange getDateTimeRangeAttribute(String name)
Gets the first value of a specific attribute, as a DateTimeRange.
List<? extends DateTimeRange> getDateTimeRangeAttributes(String name)
Gets all the values of a specific attribute, as a list of DateTimeRange.
String getDeliveryNotes()
Gets delivery notes attribute
NumberUnit<Float> getDeliveryRadius()
Gets delivery radius.
DateTime getExpirationDate()
Gets the date and time at which the entry expires.
Float getFloatAttribute(String name)
Gets the first value of a specific attribute, as a Float.
NumberUnit<Float> getFloatUnitAttribute(String name)
Gets the first value of a specific attribute, as an float, followed by a unit name.
Group getGroupAttribute(String name)
Gets the first value of a specific attribute, as a Group.
Collection<? extends Group> getGroupAttributes(String groupName)
Gets all the values of a specific attribute, as a collection of Groups.
XmlParser.ElementHandler getHandler(ExtensionProfile extensionProfile, String uri, String localName, Attributes attributes)
String getImageLink()
Gets the first URL to an image representing this item.
List<? extends String> getImageLinks()
Gets all URLs to images representing this item.
Integer getIntAttribute(String name)
Gets the first value of a specific attribute, as an Integer.
NumberUnit<Integer> getIntUnitAttribute(String name)
Gets the first value of a specific attribute, as an integer, followed by a unit name.
String getItemType()
Gets the item type.
Collection<? extends String> getLabels()
Gets the labels set for the entry.
String getLocation()
Gets the location.
String getLocationAttribute(String name)
Gets the first value of a specific location attribute, as an address.
Location getLocationAttributeAsObject(String name)
Gets the first value of a specific location attribute, as a location object.
List<? extends String> getLocationAttributes(String name)
Gets all the values of a specific location attribute, as a list of strings.
List<Location> getLocationAttributesAsObjects(String name)
Gets all the values of a specific attribute, as a list of Location objects.
Number getNumberAttribute(String name)
Gets the first value of a specific attribute, as a Number.
NumberUnit<? extends Number> getNumberUnitAttribute(String name)
Gets the first value of a specific attribute, as a Number, followed by a unit name.
Collection<? extends String> getPaymentMethods()
Gets a collection of accepted payment methods (Cash, WireTransfer, ...).
String getPaymentNotes()
Gets payment notes attribute
Boolean getPickup()
Gets pickup attribute, or null.
NumberUnit<Float> getPrice()
Gets the price of the item.
String getPriceType()
Gets price type.
String getPriceUnits()
Gets price units.
Integer getQuantity()
Gets quantity, or null if not set.
String getReferenceAttribute(String name)
Gets the first value of a specific reference attribute.
Collection<? extends Shipping> getShipping()
Gets shipping attributes.
Shipping getShippingAttribute(String name)
Gets the first value of a specific attribute, as a Shipping.
List<? extends Shipping> getShippingAttributes(String name)
Gets all the values of a specific attribute, as a list of Shippings.
Collection<? extends Tax> getTax()
Gets tax attributes.
Tax getTaxAttribute(String name)
Gets the first value of a specific attribute, as a Tax.
List<? extends Tax> getTaxAttributes(String name)
Gets all the values of a specific attribute, as a list of Taxs.
Float getTaxPercent()
This method is deprecated. use getTax() instead
String getTaxRegion()
This method is deprecated. use getTax() instead
String getTextAttribute(String name)
Gets the first value of a specific attribute, as a string.
List<String> getTextAttributeValues(String attributeName)
Gets all the values of a specific attribute, as a list of strings.
String getUrlAttribute(String name)
Gets the first value of a specific attribute, as an url.
void removeAttribute(GoogleBaseAttribute value)
Removes an attribute from the list.
void removeAttributes(String name, GoogleBaseAttributeType type)
Removes all attributes with a certain name and type from the list.
void removeAttributes(String name)
Removes all attributes with a certain name from the list.
void setApplication(String name)
Sets the application attribute.
void setDeliveryNotes(String notes)
Sets delivery notes attribute.
void setDeliveryRadius(NumberUnit<Float> value)
Sets delivery radius.
void setDeliveryRadius(float value, String unit)
Sets delivery radius.
void setExpirationDate(DateTime date)
Sets the date at which the entry expires.
void setItemType(String value)
Sets the item type.
void setLocation(String value)
Sets the location.
void setPaymentNotes(String notes)
Sets payment notes attribute.
void setPickup(boolean pickup)
Sets pickup attribute.
void setPrice(float value, String currency)
Sets the price of the item.
void setPrice(NumberUnit<Float> value)
Sets the price of the item.
void setPriceType(String type)
Sets price type.
void setPriceUnits(String value)
Sets price units.
void setQuantity(int value)
Sets quantity.
void setTaxPercent(float taxPercent)
This method is deprecated. use addTax(Tax) instead
void setTaxRegion(String region)
This method is deprecated. use addTax(Tax) instead
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

public static final String APPLICATION_ATTRIBUTE

Attribute <g:application>.

Constant Value: "application"

public static final String CUSTOMER_ID

Attribute <g:customer_id>.

See Also
Constant Value: "customer id"

public static final String DELIVERY_NOTES_ATTRIBUTE

Attribute <g:delivery_notes>.

Constant Value: "delivery notes"

public static final String DELIVERY_RADIUS_ATTRIBUTE

Attribute <g:delivery_radius>.

Constant Value: "delivery radius"

public static final String EXPIRATION_DATE_ATTRIBUTE

Attribute <g:expiration_date>.

Constant Value: "expiration date"

static final String GM_ADJUSTED_NAME_ATTRIBUTE

Meta attribute gm:adjusted_name.

Constant Value: "adjusted_name"

static final String GM_ADJUSTED_VALUE_ATTRIBUTE

Meta attribute gm:adjusted_value.

Constant Value: "adjusted_value"

static final String GM_THUMBNAIL_ATTRIBUTE

Meta attribute gm:thumbnail.

Constant Value: "thumbnail"

public static final String IMAGE_LINK_ATTRIBUTE

Attribute <g:image_link>.

Constant Value: "image link"

public static final String ITEM_TYPE_ATTRIBUTE

Attribute <g:item_type>.

Constant Value: "item type"

public static final String LABEL_ATTRIBUTE

Attribute <g:label>.

Constant Value: "label"

public static final String LOCATION_ATTRIBUTE

Attribute <g:location>.

Constant Value: "location"

public static final String PAYMENT_METHOD_ATTRIBUTE

Attribute <g:payment_accepted>.

Constant Value: "payment accepted"

public static final String PAYMENT_NOTES_ATTRIBUTE

Attribute <g:payment_notes>.

Constant Value: "payment notes"

public static final String PICKUP_ATTRIBUTE

Attribute <g:pickup>.

Constant Value: "pickup"

public static final String PRICE_ATTRIBUTE

Attribute <g:price>.

Constant Value: "price"

public static final String PRICE_TYPE_ATTRIBUTE

Attribute <g:price_type>.

Constant Value: "price type"

public static final String PRICE_UNITS_ATTRIBUTE

Attribute <g:price_units>.

Constant Value: "price units"

public static final String QUANTITY_ATTRIBUTE

Attribute <g:quantity>.

Constant Value: "quantity"

public static final String SHIPPING_ATTRIBUTE

Attribute <g:shipping>.

Constant Value: "shipping"

public static final String TAX_ATTRIBUTE

Attribute <g:tax>.

Constant Value: "tax"

public static final String TAX_PERCENT_ATTRIBUTE

This constant is deprecated.
use TAX_ATTRIBUTE instead

Attribute <g:tax_percent>.

Constant Value: "tax percent"

public static final String TAX_REGION_ATTRIBUTE

This constant is deprecated.
use TAX_ATTRIBUTE instead

Attribute <g:tax_region>.

Constant Value: "tax region"

Fields

public static final ExtensionDescription DESCRIPTION

A description for this extension, to pass to an ExtensionProfile.

private final List<GoogleBaseAttribute> attributes

All the attributes available for the current ExtensionPoint in this extension namespace. Several GoogleBaseAttribute might have the same name and even the same value. Order is conserved, but should not be significant.

Public Constructors

public GoogleBaseAttributesExtension ()

Public Methods

public GoogleBaseAttribute addAttribute (GoogleBaseAttribute attribute)

Adds an attribute to the list. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
attribute
Returns
  • the attribute passed as parameter

public GoogleBaseAttribute addBooleanAttribute (String name, boolean value)

Adds an attribute of type BOOLEAN. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addDateAttribute (String name, DateTime date)

Adds an attribute of type DATE. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
date Attribute value
Returns
  • the attribute object that has been created and added to the item
Throws
IllegalArgumentException if the attribute value is not only a date, but a date and a time (see isDateOnly())

public GoogleBaseAttribute addDateTimeAttribute (String name, DateTime dateTime)

Adds an attribute of type DATE_TIME. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
dateTime Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addDateTimeRangeAttribute (String name, DateTimeRange dateTimeRange)

Adds an attribute of type DATE_TIME_RANGE. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
dateTimeRange Attribute value
Returns
  • the attribute object that has been created and added to the item
Throws
IllegalArgumentException if the DateTimeRange is an empty range, in which case addDateTimeAttribute(String, com.google.gdata.data.DateTime) should be used instead.

public GoogleBaseAttribute addFloatAttribute (String name, float value)

Adds an attribute of type FLOAT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addFloatUnitAttribute (String name, NumberUnit<Float> value)

Adds an attribute of type FLOAT_UNIT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addFloatUnitAttribute (String name, float value, String unit)

Adds an attribute of type FLOAT_UNIT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value
unit
Returns
  • the attribute object that has been created and added to the item

public void addGroupAttribute (String groupName, Group group)

Adds group attribute.

Parameters
groupName
group

public void addImageLink (String link)

Adds an image URL.

Parameters
link

public GoogleBaseAttribute addIntAttribute (String name, int value)

Adds an attribute of type INT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addIntUnitAttribute (String name, int value, String unit)

Adds an attribute of type INT_UNIT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value
unit
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addIntUnitAttribute (String name, NumberUnit<Integer> value)

Adds an attribute of type INT_UNIT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public void addLabel (String value)

Adds a label to the entry.

Parameters
value

public GoogleBaseAttribute addLocationAttribute (String name, Location location)

Adds an attribute of type LOCATION. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
location Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addLocationAttribute (String name, String location)

Adds an attribute of type LOCATION. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
location Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addNumberAttribute (String name, Number value)

Adds an attribute of type NUMBER. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addNumberUnitAttribute (String name, NumberUnit<Number> value)

Adds an attribute of type NUMBER_UNIT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addNumberUnitAttribute (String name, Number value, String unit)

Adds an attribute of type NUMBER_UNIT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value
unit
Returns
  • the attribute object that has been created and added to the item

public void addPaymentMethod (String method)

Adds an accepted payment method.

Parameters
method

public GoogleBaseAttribute addReferenceAttribute (String name, String value)

Adds an attribute of type REFERENCE. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public void addShipping (Shipping shipping)

Adds shipping attribute.

Parameters
shipping

public void addShippingAttribute (String name, Shipping shipping)

Adds an attribute of type SHIPPING. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
shipping Attribute value

public void addTax (Tax tax)

Adds tax attribute.

Parameters
tax

public void addTaxAttribute (String name, Tax tax)

Adds an attribute of type TAX. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
tax Attribute value

public GoogleBaseAttribute addTextAttribute (String name, String value)

Adds an attribute of type TEXT. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public GoogleBaseAttribute addUrlAttribute (String name, String value)

Adds an attribute of type URL. This method will never remove an attribute, even if it has the same name as the new attribute. If you would like to set an attribute that can only appear once, call removeAttributes(String, GoogleBaseAttributeType) first.

Parameters
name Attribute name
value Attribute value
Returns
  • the attribute object that has been created and added to the item

public void clearAttributes ()

Removes all attributes from the list.

public void generate (XmlWriter xmlWriter, ExtensionProfile extensionProfile)

Implements generate(XmlWriter, ExtensionProfile). This method generates XML code for the attribute in this extension. It is meant to be called by the Google data library.

Parameters
xmlWriter XML writer
extensionProfile Extension profile
Throws
IOException

public String getApplication ()

Gets the application attribute. This attribute should contain the name of the last application that modified the entry. This is informative only and should not be relied on.

Returns
  • application attribute

public GoogleBaseAttribute getAttribute (String name, GoogleBaseAttributeType type)

Gets the first attribute with a certain name and type. In most cases, there might be more than one attribute with the same name and type. This method will ignore extra attributes. Use getAttributes(String) to make sure you get all of them.

Parameters
name Attribute name
type Attribute type (null to ignore the type)
Returns

public GoogleBaseAttribute getAttribute (String name)

Gets the first attribute with a certain name. In most cases, there might be more than one attribute with the same name. This method will ignore extra attributes. Use getAttributes(String) to make sure you get all of them.

Parameters
name Attribute name
Returns

public List<? extends GoogleBaseAttribute> getAttributes (String name)

Gets all the attributes with a certain name and type.

Parameters
name Attribute name
Returns

public List<? extends GoogleBaseAttribute> getAttributes (String name, GoogleBaseAttributeType type)

Gets all the attributes with a certain name and type.

Parameters
name Attribute name
type Attribute type, null to ignore the type
Returns

public List<? extends GoogleBaseAttribute> getAttributes ()

Gets a list of all the attributes available in the extension namespace at the current ExtensionPoint. Attributes might be repeated.

Returns

public Boolean getBooleanAttribute (String name)

Gets the first value of a specific attribute, as an Boolean. This method only takes into account attributes of type BOOLEAN.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list

public Integer getCustomerId ()

public DateTime getDateAttribute (String name)

Gets the first value of a specific attribute, as a date. This method only takes into account attributes of type DATE_TIME and DATE.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public DateTimeRange getDateRangeAttribute (String name)

Gets the first value of a specific attribute, as a date/dateTime range. This method only takes into account attributes of type DATE_TIME, DATE and DATE_TIME_RANGE.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public DateTime getDateTimeAttribute (String name)

Gets the first value of a specific attribute, as a date and a time. This method only takes into account attributes of type DATE_TIME.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public DateTimeRange getDateTimeRangeAttribute (String name)

Gets the first value of a specific attribute, as a DateTimeRange. This method does not check the type of the attribute that's being queried, it just gets the value and try and convert it.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public List<? extends DateTimeRange> getDateTimeRangeAttributes (String name)

Gets all the values of a specific attribute, as a list of DateTimeRange. This method does not check the type of the attribute that's being queried, it just gets the values and try and convert them.

Parameters
name Attribute name
Returns
  • a list of DateTimeRange, which might be empty but not null
Throws
NumberFormatException if some value was found that could not be converted

public String getDeliveryNotes ()

Gets delivery notes attribute

public NumberUnit<Float> getDeliveryRadius ()

Gets delivery radius.

public DateTime getExpirationDate ()

Gets the date and time at which the entry expires.

public Float getFloatAttribute (String name)

Gets the first value of a specific attribute, as a Float. This method only takes into account attributes of type FLOAT.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public NumberUnit<Float> getFloatUnitAttribute (String name)

Gets the first value of a specific attribute, as an float, followed by a unit name. This method only takes into account attributes of type FLOAT_UNIT.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public Group getGroupAttribute (String name)

Gets the first value of a specific attribute, as a Group. This method does not check the type of the attribute that's being queried, it just gets the value and try and convert it.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list

public Collection<? extends Group> getGroupAttributes (String groupName)

Gets all the values of a specific attribute, as a collection of Groups. This method does not check the type of the attribute that's being queried, it just gets the values and try and convert them.

Parameters
groupName The group name
Returns
  • a list of Group, which might be empty but not null

public XmlParser.ElementHandler getHandler (ExtensionProfile extensionProfile, String uri, String localName, Attributes attributes)

Implements getHandler(ExtensionProfile, String, String, Attributes). This method returns a handler object that can parse an attribute in the current namespace and add the corresponding GoogleBaseAttribute into the list. It is meant to be called by the Google data library.

Parameters
extensionProfile Extension profile
uri Extension namespace
localName Tag name, without the namespace prefix
attributes Tag attributes
Returns
  • an element handler
Throws
IOException
ParseException

public String getImageLink ()

Gets the first URL to an image representing this item.

public List<? extends String> getImageLinks ()

Gets all URLs to images representing this item.

public Integer getIntAttribute (String name)

Gets the first value of a specific attribute, as an Integer. This method only takes into account attributes of type INT.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public NumberUnit<Integer> getIntUnitAttribute (String name)

Gets the first value of a specific attribute, as an integer, followed by a unit name. This method only takes into account attributes of type INT_UNIT.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public String getItemType ()

Gets the item type.

public Collection<? extends String> getLabels ()

Gets the labels set for the entry.

Returns
  • a collection of strings, which might be empty but not null

public String getLocation ()

Gets the location.

public String getLocationAttribute (String name)

Gets the first value of a specific location attribute, as an address. If you would like to get latitude and longitude and not just the address, use getLocationAttributeAsObject(String) instead.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted.

public Location getLocationAttributeAsObject (String name)

Gets the first value of a specific location attribute, as a location object.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted.

public List<? extends String> getLocationAttributes (String name)

Gets all the values of a specific location attribute, as a list of strings.

Parameters
name Attribute name
Returns
  • a list of locations, which might be empty but not null
Throws
NumberFormatException if some value was found that could not be converted

public List<Location> getLocationAttributesAsObjects (String name)

Gets all the values of a specific attribute, as a list of Location objects.

Parameters
name Attribute name
Returns
  • a list of locations, which might be empty but not null
Throws
NumberFormatException if some value was found that could not be converted

public Number getNumberAttribute (String name)

Gets the first value of a specific attribute, as a Number. This method only takes into account attributes of type NUMBER.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public NumberUnit<? extends Number> getNumberUnitAttribute (String name)

Gets the first value of a specific attribute, as a Number, followed by a unit name. This method only takes into account attributes of type NUMBER_UNIT, INT_UNIT or FLOAT_UNIT.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted

public Collection<? extends String> getPaymentMethods ()

Gets a collection of accepted payment methods (Cash, WireTransfer, ...).

Returns
  • a collection of strings, which might be empty but not null.

public String getPaymentNotes ()

Gets payment notes attribute

public Boolean getPickup ()

Gets pickup attribute, or null.

public NumberUnit<Float> getPrice ()

Gets the price of the item.

Returns
  • a price (value and currency) or null

public String getPriceType ()

Gets price type.

public String getPriceUnits ()

Gets price units.

public Integer getQuantity ()

Gets quantity, or null if not set.

public String getReferenceAttribute (String name)

Gets the first value of a specific reference attribute. This method only takes into account attributes of type REFERENCE.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no reference attribute with this name was found on the list

public Collection<? extends Shipping> getShipping ()

Gets shipping attributes.

public Shipping getShippingAttribute (String name)

Gets the first value of a specific attribute, as a Shipping. This method does not check the type of the attribute that's being queried, it just gets the value and try and convert it.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted.

public List<? extends Shipping> getShippingAttributes (String name)

Gets all the values of a specific attribute, as a list of Shippings. This method does not check the type of the attribute that's being queried, it just gets the values and try and convert them.

Parameters
name Attribute name
Returns
  • a list of Shipping, which might be empty but not null
Throws
NumberFormatException if some value was found that could not be converted

public Collection<? extends Tax> getTax ()

Gets tax attributes.

public Tax getTaxAttribute (String name)

Gets the first value of a specific attribute, as a Tax. This method does not check the type of the attribute that's being queried, it just gets the value and try and convert it.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list
Throws
NumberFormatException if some value was found that could not be converted.

public List<? extends Tax> getTaxAttributes (String name)

Gets all the values of a specific attribute, as a list of Taxs. This method does not check the type of the attribute that's being queried, it just gets the values and try and convert them.

Parameters
name Attribute name
Returns
  • a list of Tax, which might be empty but not null
Throws
NumberFormatException if some value was found that could not be converted

public Float getTaxPercent ()

This method is deprecated.
use getTax() instead

Gets tax percent attribute, or null.

public String getTaxRegion ()

This method is deprecated.
use getTax() instead

Gets tax region attribute.

public String getTextAttribute (String name)

Gets the first value of a specific attribute, as a string. If it makes sense for the attribute to appear more than once, you might consider calling getTextAttributeValues(String) instead. This method checks the type of the attribute that is being queried. Use #getAttributeAsString(String, GoogleBaseAttributeType) if you would like to get the value of non-string attributes.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list

public List<String> getTextAttributeValues (String attributeName)

Gets all the values of a specific attribute, as a list of strings. This method checks the type of the attribute that are being queried. Use #getAttributeAsString(String, GoogleBaseAttributeType) if you would like to get the value non-string attributes.

Parameters
attributeName
Returns
  • a list of strings, which might be empty but not null

public String getUrlAttribute (String name)

Gets the first value of a specific attribute, as an url. This method only takes into account attributes of type URL.

Parameters
name Attribute name
Returns
  • value of the attribute or null if no attribute with this name was found on the list

public void removeAttribute (GoogleBaseAttribute value)

Removes an attribute from the list.

Parameters
value

public void removeAttributes (String name, GoogleBaseAttributeType type)

Removes all attributes with a certain name and type from the list.

Parameters
name Name of the attributes that should be removed
type Attribute type, null to ignore the type

public void removeAttributes (String name)

Removes all attributes with a certain name from the list.

Parameters
name Name of the attributes that should be removed

public void setApplication (String name)

Sets the application attribute. This attribute should be set every time an entry is inserted or updated. It is set automatically by GoogleBaseService#update(java.net.URL, com.google.gdata.data.BaseEntry) GoogleBaseService#insert(java.net.URL, com.google.gdata.data.BaseEntry) and GoogleBaseService#batch(java.net.URL, com.google.gdata.data.BaseFeed).

Parameters
name

public void setDeliveryNotes (String notes)

Sets delivery notes attribute.

Parameters
notes

public void setDeliveryRadius (NumberUnit<Float> value)

Sets delivery radius.

Parameters
value

public void setDeliveryRadius (float value, String unit)

Sets delivery radius.

Parameters
value
unit

public void setExpirationDate (DateTime date)

Sets the date at which the entry expires.

Parameters
date

public void setItemType (String value)

Sets the item type.

Parameters
value

public void setLocation (String value)

Sets the location.

Parameters
value

public void setPaymentNotes (String notes)

Sets payment notes attribute.

Parameters
notes

public void setPickup (boolean pickup)

Sets pickup attribute.

Parameters
pickup

public void setPrice (float value, String currency)

Sets the price of the item.

Parameters
value
currency

public void setPrice (NumberUnit<Float> value)

Sets the price of the item.

Parameters
value

public void setPriceType (String type)

Sets price type.

Parameters
type

public void setPriceUnits (String value)

Sets price units.

Parameters
value

public void setQuantity (int value)

Sets quantity.

Parameters
value

public void setTaxPercent (float taxPercent)

This method is deprecated.
use addTax(Tax) instead

Sets tax percent attribute.

Parameters
taxPercent

public void setTaxRegion (String region)

This method is deprecated.
use addTax(Tax) instead

Sets tax region attribute.

Parameters
region