/** * Get the list of attribute ids defined for this item type. * * @return unmodifiable list of attribute ids * @deprecated use {@link #getAttributes()} instead */ public List<? extends GoogleBaseAttributeId> getAttributeIds() { return getGmAttributesExtension().getAttributeIds(); }
/** * Sets the price of the item. * * @param value * @param currency */ public void setPrice(float value, String currency) { setPrice(new NumberUnit<Float>(value, currency)); }
/** * Creates a new, empty feed. */ public GoogleBaseFeed() { super(GoogleBaseEntry.class); googleBaseAttributesExtension = new GoogleBaseAttributesExtension(); addExtension(googleBaseAttributesExtension); }
private boolean hasNameAndType(GoogleBaseAttribute attr, String name, GoogleBaseAttributeType type) { GoogleBaseAttributeType subtype = attr.getAttributeId().getType(); return name.equals(attr.getAttributeId().getName()) && (type == null || subtype != null && type.isSupertypeOf(subtype)); }
@Override public boolean equals(Object o) { if (o == null || !(o instanceof GoogleBaseAttribute)) { return false; } GoogleBaseAttribute other = (GoogleBaseAttribute)o; return attributeId.equals(other.attributeId) && privateAccess == other.privateAccess && equalsMaybeNull(textValue, other.textValue) && equalsMaybeNull(subElements, other.subElements); } private static boolean equalsMaybeNull(Object a, Object b) {
/** * Creates a new entry. */ public GoogleBaseEntry() { googleBaseAttributesExtension = new GoogleBaseAttributesExtension(); addExtension(googleBaseAttributesExtension); }
/** * Sets attribute name and type. */ public void setAttributeId(String name, GoogleBaseAttributeType type) { setAttributeId(new GoogleBaseAttributeId(name, type)); }
/** * Extracts a {@link Group} object from the value of a * {@link com.google.api.gbase.client.GoogleBaseAttribute}. * * @param attribute */ public static Group extractGroup(GoogleBaseAttribute attribute) { return new Group(attribute.getSubAttributes()); }
/** * Get the list of attribute ids with extra information as defined for this * item type. * * @return unmodifiable list of GmAttribute objects */ public Collection<GmAttribute> getAttributes() { return getGmAttributesExtension().getAttributes(); }
/** Sets delivery radius. */ public void setDeliveryRadius(float value, String unit) { setDeliveryRadius(new NumberUnit<Float>(value, unit)); }
/** Adds group attribute. */ public void addGroupAttribute(String groupName, Group group) { addAttribute(ConversionUtil.createAttribute(groupName, group)); }
private boolean hasNameAndType(GoogleBaseAttribute attr, String name, GoogleBaseAttributeType type) { GoogleBaseAttributeType subtype = attr.getAttributeId().getType(); return name.equals(attr.getAttributeId().getName()) && (type == null || subtype != null && type.isSupertypeOf(subtype)); }
/** * Get the list of attribute ids defined for this item type. * * @return unmodifiable list of attribute ids * @deprecated use {@link #getAttributes()} instead */ public List<? extends GoogleBaseAttributeId> getAttributeIds() { return getGmAttributesExtension().getAttributeIds(); }
/** * Sets the price of the item. * * @param value * @param currency */ public void setPrice(float value, String currency) { setPrice(new NumberUnit<Float>(value, currency)); }
/** * Creates a new, empty feed. */ public GoogleBaseFeed() { super(GoogleBaseEntry.class); googleBaseAttributesExtension = new GoogleBaseAttributesExtension(); addExtension(googleBaseAttributesExtension); }
@Override public boolean equals(Object o) { if (o == null || !(o instanceof GoogleBaseAttribute)) { return false; } GoogleBaseAttribute other = (GoogleBaseAttribute)o; return attributeId.equals(other.attributeId) && privateAccess == other.privateAccess && equalsMaybeNull(textValue, other.textValue) && equalsMaybeNull(subElements, other.subElements); } private static boolean equalsMaybeNull(Object a, Object b) {
/** * Creates a new entry. */ public GoogleBaseEntry() { googleBaseAttributesExtension = new GoogleBaseAttributesExtension(); addExtension(googleBaseAttributesExtension); }
/** * Sets attribute name and type. */ public void setAttributeId(String name, GoogleBaseAttributeType type) { setAttributeId(new GoogleBaseAttributeId(name, type)); }
/** * Extracts a {@link Group} object from the value of a * {@link com.google.api.gbase.client.GoogleBaseAttribute}. * * @param attribute */ public static Group extractGroup(GoogleBaseAttribute attribute) { return new Group(attribute.getSubAttributes()); }
/** * Get the list of attribute ids with extra information as defined for this * item type. * * @return unmodifiable list of GmAttribute objects */ public Collection<GmAttribute> getAttributes() { return getGmAttributesExtension().getAttributes(); }