/** * Returns the {@link AttributeValueSet} corresponding to the provided <code>id</code> * or <code>null</code> if no {@link AttributeValueSet} corresponds to the * <code>id</code>. * * @return the {@link AttributeValueSet} corresponding to the provided <code>id</code> * or <code>null</code> if no {@link AttributeValueSet} corresponds to the * <code>id</code>. */ public AttributeValueSet getAttributeValueSet(String id) { return getAttributeValueSet(id, false); }
/** * Returns the default {@link AttributeValueSet} of this {@link AttributeValueSets} or * the first available {@link AttributeValueSet} if * {@link #getDefaultAttributeValueSetId()} is <code>null</code>. If this * {@link AttributeValueSets} is empty, <code>null</code> will be returned. */ public AttributeValueSet getDefaultAttributeValueSet() { AttributeValueSet result = null; if (defaultAttributeValueSetId != null) { result = getAttributeValueSet(defaultAttributeValueSetId); } // Try the first attribute set if (result == null) { final Iterator<AttributeValueSet> iterator = attributeValueSets.values() .iterator(); if (iterator.hasNext()) { result = iterator.next(); } } return result; }
private Map<String, Object> getAttributes() { Map<String, Object> result = AttributeValueSet .getAttributeValues(getAttributeSets().getAttributeValueSet(attributeSetId, true)); if (result == null) { result = Maps.newHashMap(); } return result; }