/** * Checks whether an attribute histogram is available in the current * entry. * * @return true if a call to {@link #getAttributeHistogram()} would work */ public boolean hasAttributeHistogram() { return owner.getExtension(AttributeHistogram.class) != null; }
/** * Checks whether statistics information is available in the current entry. * * @return true if a call to {@link #getStats()} would return a Stats * object */ public boolean hasStats() { return owner.getExtension(Stats.class) != null; }
/** * Checks whether an attribute histogram is available in the current * entry. * * @return true if a call to {@link #getAttributeHistogram()} would work */ public boolean hasAttributeHistogram() { return owner.getExtension(AttributeHistogram.class) != null; }
/** * Checks whether statistics information is available in the current entry. * * @return true if a call to {@link #getStats()} would return a Stats * object */ public boolean hasStats() { return owner.getExtension(Stats.class) != null; }
/** Gets statistics, if available. */ public Stats getStats() { return owner.getExtension(Stats.class); }
/** Gets statistics, if available. */ public Stats getStats() { return owner.getExtension(Stats.class); }
/** * Gets attribute histogram information. * * @return attribute histogram information fond in the feed * @exception IllegalStateException if the feed was not an * histogram feed. */ public AttributeHistogram getAttributeHistogram() { AttributeHistogram histogram = owner.getExtension(AttributeHistogram.class); if (histogram == null) { throw new IllegalStateException("Not a histogram feed entry."); } return histogram; }
/** * Gets attribute histogram information. * * @return attribute histogram information fond in the feed * @exception IllegalStateException if the feed was not an * histogram feed. */ public AttributeHistogram getAttributeHistogram() { AttributeHistogram histogram = owner.getExtension(AttributeHistogram.class); if (histogram == null) { throw new IllegalStateException("Not a histogram feed entry."); } return histogram; }
/** * Convenience method for getting a batchId from * an entry if it's there. * * @param entry * @return the id or null if it's not defined */ public static String getIdFrom(BaseEntry<?> entry) { BatchId tag = entry.getExtension(BatchId.class); return tag == null ? null : tag.getId(); }
/** * Convenience method for getting a batchId from * an entry if it's there. * * @param entry * @return the id or null if it's not defined */ public static String getIdFrom(BaseEntry<?> entry) { BatchId tag = entry.getExtension(BatchId.class); return tag == null ? null : tag.getId(); }
/** * Gets the item type name. */ public String getName() { GmItemType tag = owner.getExtension(GmItemType.class); return tag == null ? null : tag.getItemType(); }
/** * Gets the item type name. */ public String getName() { GmItemType tag = owner.getExtension(GmItemType.class); return tag == null ? null : tag.getItemType(); }
/** * Convenience method for getting a batchId from * an entry if it's there. * * @param entry * @return the id or null if it's not defined */ public static String getIdFrom(BaseEntry<?> entry) { BatchId tag = entry.getExtension(BatchId.class); return tag == null ? null : tag.getId(); }
/** * Sets the application attribute using the name passed to the * constructor. * * @param e */ private void addApplicationAttribute(IEntry iEntry) { if (!(iEntry instanceof BaseEntry)) { throw new IllegalArgumentException( "Unexpected entry type: " + iEntry.getClass()); } BaseEntry<?> e = (BaseEntry<?>) iEntry; GoogleBaseAttributesExtension attrs = e.getExtension(GoogleBaseAttributesExtension.class); if (attrs == null) { return; } attrs.setApplication(application); }
/** * Sets the application attribute using the name passed to the * constructor. * * @param e */ private void addApplicationAttribute(IEntry iEntry) { if (!(iEntry instanceof BaseEntry)) { throw new IllegalArgumentException( "Unexpected entry type: " + iEntry.getClass()); } BaseEntry<?> e = (BaseEntry<?>) iEntry; GoogleBaseAttributesExtension attrs = e.getExtension(GoogleBaseAttributesExtension.class); if (attrs == null) { return; } attrs.setApplication(application); }
/** * Returns the GmAttributes instance associated to the owner of the * description. If the owner has no GmAttributes defined, a new instance * is created, assigned to the owner and returned. */ private GmAttributes getGmAttributesExtension() { GmAttributes attributes = owner.getExtension(GmAttributes.class); if (attributes == null) { attributes = new GmAttributes(); owner.setExtension(attributes); } return attributes; } }
/** * Returns the GmAttributes instance associated to the owner of the * description. If the owner has no GmAttributes defined, a new instance * is created, assigned to the owner and returned. */ private GmAttributes getGmAttributesExtension() { GmAttributes attributes = owner.getExtension(GmAttributes.class); if (attributes == null) { attributes = new GmAttributes(); owner.setExtension(attributes); } return attributes; } }