public class Format
extends java.lang.Object
Constructor and Description |
---|
Format(java.util.Map<FormatKey,java.lang.Object> properties)
Creates a new format onlyWith the specified properties.
|
Format(java.lang.Object... p)
Creates a new format onlyWith the specified properties.
|
Modifier and Type | Method and Description |
---|---|
Format |
append(Format that)
Creates a new format which contains all properties from this format and
additional properties from that format.
|
Format |
append(java.lang.Object... p)
Creates a new format which contains all properties from this format and
additional properties listed.
|
boolean |
containsKey(FormatKey key) |
Format |
containsKeys(FormatKey... keys)
Returns true if the format has the specified keys.
|
<T> T |
get(FormatKey<T> key) |
<T> T |
get(FormatKey<T> key,
T defaultValue) |
java.util.Set<FormatKey> |
getKeys()
Gets the keys of the format as an unmodifiable set.
|
java.util.Map<FormatKey,java.lang.Object> |
getProperties()
Gets the properties of the format as an unmodifiable map.
|
Format |
intersectKeys(FormatKey... keys)
Creates a new format which only has the specified keys (or less).
|
boolean |
matches(Format that)
Returns true if that format matches this format.
|
boolean |
matchesWithout(Format that,
FormatKey... without) |
Format |
prepend(Format that)
Creates a new format which contains all properties from the specified
format and additional properties from this format.
|
Format |
prepend(java.lang.Object... p)
Creates a new format which contains all specified properties and
additional properties from this format.
|
Format |
removeKeys(FormatKey... keys)
Creates a new format without the specified keys.
|
java.lang.String |
toString() |
public Format(java.util.Map<FormatKey,java.lang.Object> properties)
public Format(java.lang.Object... p)
public <T> T get(FormatKey<T> key)
public <T> T get(FormatKey<T> key, T defaultValue)
public boolean containsKey(FormatKey key)
public java.util.Map<FormatKey,java.lang.Object> getProperties()
public java.util.Set<FormatKey> getKeys()
public boolean matches(Format that)
that
- Another format.public Format append(Format that)
If a property is specified in both formats, then the property value from this format is used. It overwrites that format.
If one of the format has more properties than the other, then the new format is more specific than this format.
that
- public Format append(java.lang.Object... p)
If a property is specified in both formats, then the property value from this format is used. It overwrites that format.
If one of the format has more properties than the other, then the new format is more specific than this format.
p
- The properties must be given as key value pairs.public Format prepend(Format that)
If a property is specified in both formats, then the property value from this format is used. It overwrites that format.
If one of the format has more properties than the other, then the new format is more specific than this format.
that
- public Format prepend(java.lang.Object... p)
If a property is specified in both formats, then the property value from this format is used. It overwrites that format.
If one of the format has more properties than the other, then the new format is more specific than this format.
p
- The properties must be given as key value pairs.public Format intersectKeys(FormatKey... keys)
If the keys are reduced, then the new format is less specific than this format.
public Format removeKeys(FormatKey... keys)
If the keys are reduced, then the new format is less specific than this format.
public Format containsKeys(FormatKey... keys)
public java.lang.String toString()
toString
in class java.lang.Object