public DIDLObject addProperty(Property property) { if (property == null) return this; getProperties().add(property); return this; }
public boolean hasProperty(java.lang.Class<? extends Property> propertyClass) { for (Property property : getProperties()) { if (propertyClass.isInstance(property)) return true; } return false; }
public <V> Property<V> getFirstProperty(java.lang.Class<? extends Property<V>> propertyClass) { for (Property property : getProperties()) { if (propertyClass.isInstance(property)) return property; } return null; }
public <V> Property<V> getLastProperty(java.lang.Class<? extends Property<V>> propertyClass) { Property found = null; for (Property property : getProperties()) { if (propertyClass.isInstance(property)) found = property; } return found; }
public <V> Property<V>[] getProperties(java.lang.Class<? extends Property<V>> propertyClass) { List<Property<V>> list = new ArrayList<>(); for (Property property : getProperties()) { if (propertyClass.isInstance(property)) list.add(property); } return list.toArray(new Property[list.size()]); }
public <V> Property<V>[] getPropertiesByNamespace(java.lang.Class<? extends Property.NAMESPACE> namespace) { List<Property<V>> list = new ArrayList<>(); for (Property property : getProperties()) { if (namespace.isInstance(property)) list.add(property); } return list.toArray(new Property[list.size()]); }
public DIDLObject removeProperties(java.lang.Class<? extends Property> propertyClass) { Iterator<Property> it = getProperties().iterator(); while (it.hasNext()) { Property property = it.next(); if (propertyClass.isInstance(property)) it.remove(); } return this; }
public DIDLObject replaceFirstProperty(Property property) { if (property == null) return this; Iterator<Property> it = getProperties().iterator(); while (it.hasNext()) { Property p = it.next(); if (p.getClass().isAssignableFrom(property.getClass())) it.remove(); } addProperty(property); return this; }
public <V> List<V> getPropertyValues(java.lang.Class<? extends Property<V>> propertyClass) { List<V> list = new ArrayList<>(); for (Property property : getProperties(propertyClass)) { list.add((V) property.getValue()); } return list; }
protected DIDLObject(DIDLObject other) { this(other.getId(), other.getParentID(), other.getTitle(), other.getCreator(), other.isRestricted(), other.getWriteStatus(), other.getClazz(), other.getResources(), other.getProperties(), other.getDescMetadata() ); }
public DIDLObject addProperty(Property property) { if (property == null) return this; getProperties().add(property); return this; }
public <V> Property<V> getFirstProperty(java.lang.Class<? extends Property<V>> propertyClass) { for (Property property : getProperties()) { if (property.getClass().isAssignableFrom(propertyClass)) return property; } return null; }
public <V> Property<V> getLastProperty(java.lang.Class<? extends Property<V>> propertyClass) { Property found = null; for (Property property : getProperties()) { if (property.getClass().isAssignableFrom(propertyClass)) found = property; } return found; }
public boolean hasProperty(java.lang.Class<? extends Property> propertyClass) { for (Property property : getProperties()) { if (property.getClass().isAssignableFrom(propertyClass)) return true; } return false; }
public <V> Property<V>[] getProperties(java.lang.Class<? extends Property<V>> propertyClass) { List<Property<V>> list = new ArrayList(); for (Property property : getProperties()) { if (property.getClass().isAssignableFrom(propertyClass)) list.add(property); } return list.toArray(new Property[list.size()]); }
public <V> Property<V>[] getPropertiesByNamespace(java.lang.Class<? extends Property.NAMESPACE> namespace) { List<Property<V>> list = new ArrayList(); for (Property property : getProperties()) { if (namespace.isAssignableFrom(property.getClass())) list.add(property); } return list.toArray(new Property[list.size()]); }
public DIDLObject removeProperties(java.lang.Class<? extends Property> propertyClass) { Iterator<Property> it = getProperties().iterator(); while (it.hasNext()) { Property p = it.next(); if (p.getClass().isAssignableFrom(propertyClass)) it.remove(); } return this; }
public <V> List<V> getPropertyValues(java.lang.Class<? extends Property<V>> propertyClass) { List<V> list = new ArrayList(); for (Property property : getProperties(propertyClass)) { list.add((V) property.getValue()); } return list; }
public DIDLObject replaceFirstProperty(Property property) { if (property == null) return this; Iterator<Property> it = getProperties().iterator(); while (it.hasNext()) { Property p = it.next(); if (p.getClass().isAssignableFrom(property.getClass())) it.remove(); } addProperty(property); return this; }
protected DIDLObject(DIDLObject other) { this(other.getId(), other.getParentID(), other.getTitle(), other.getCreator(), other.isRestricted(), other.getWriteStatus(), other.getClazz(), other.getResources(), other.getProperties(), other.getDescMetadata() ); }