Package net.sf.okapi.common.resource
Interface IWithProperties
-
- All Known Subinterfaces:
IMultilingual,INameable,IResource,ITextUnit
- All Known Implementing Classes:
BaseNameable,BaseReferenceable,Code,Custom,DocumentPart,Ending,EndSubfilter,MultiEvent,PipelineParameters,RawDocument,Segment,StartDocument,StartGroup,StartSubDocument,StartSubfilter,StorageList,TextContainer,TextPart,TextUnit
public interface IWithProperties
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static voidcopy(IWithProperties from, IWithProperties to)Copy allIWithPropertiesUnless destination already has the property. Properties are cloned before copying.Map<String,Property>getProperties()default PropertygetProperty(String name)Gets the resource-level property for a given name.default Set<String>getPropertyNames()Gets the names of all the resource-level properties for this resource.default booleanhasProperty(String name)Indicates if a resource-level property exists for a given name.default Iterator<Property>propertyIterator()Gets an iterator of the properties for this resource.default voidremoveProperty(String name)Removes a resource-level property of a given name.default PropertysetProperty(Property property)Sets a resource-level property.
-
-
-
Method Detail
-
copy
static void copy(IWithProperties from, IWithProperties to)
Copy allIWithPropertiesUnless destination already has the property. Properties are cloned before copying.- Parameters:
from- source ofIWithPropertiesto- destination ofIWithProperties
-
getProperties
Map<String,Property> getProperties()
- Returns:
Mapof properties for the implementer of interface
-
getProperty
default Property getProperty(String name)
Gets the resource-level property for a given name.- Parameters:
name- Name of the property to retrieve.- Returns:
- The property or null if it does not exist.
-
getPropertyNames
default Set<String> getPropertyNames()
Gets the names of all the resource-level properties for this resource.- Returns:
- All the names of the resource-level properties for this resource.
-
hasProperty
default boolean hasProperty(String name)
Indicates if a resource-level property exists for a given name.- Parameters:
name- The name of the resource-level property to query.- Returns:
- True if a resource-level property exists, false otherwise.
-
removeProperty
default void removeProperty(String name)
Removes a resource-level property of a given name. If the property does not exists nothing happens.- Parameters:
name- The name of the property to remove.
-
setProperty
default Property setProperty(Property property)
Sets a resource-level property. If a property already exists it is overwritten.- Parameters:
property- The new property to set.- Returns:
- The property that has been set.
-
-