Package org.bedework.eventreg.db
Class BwProperty
- All Implemented Interfaces:
Serializable,Comparable<BwProperty>
An arbitrary property value in bedework. This may be used to support, for
example, x-properties. This will probably be subclassed to provide further
support.
- Version:
- 1.0
- See Also:
-
Field Summary
Fields inherited from class org.bedework.eventreg.db.SerializableProperties
vals -
Constructor Summary
ConstructorsConstructorDescriptionConstructorBwProperty(String name, String value) Create a string by specifying all its fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck this is properly trimmedclone()Make visibleintcompareTo(BwProperty that) static BwPropertyfindName(String name, Collection<BwProperty> c) Search the collection for a string that matches the given name.getName()Get the namegetValue()Get the valueinthashCode()voidSet the namevoidSet the valuetoString()protected voidtoStringSegment(org.bedework.util.misc.ToString ts) Add our stuff to the StringBuilderbooleanupdate(BwProperty from) Figure out what's different and update it.Methods inherited from class org.bedework.eventreg.db.DbItem
equals, getId, getSeq, setId, setSeq, unsavedMethods inherited from class org.bedework.eventreg.db.SerializableProperties
asMap, asString, getMap, getProperties, getVals, init, may, mayBool, mayInt, mayList, mayList, must, mustList, setBoolean, setInt, setObject, setProperties, setString
-
Constructor Details
-
BwProperty
public BwProperty()Constructor -
BwProperty
Create a string by specifying all its fields- Parameters:
name- String property namevalue- String value
-
-
Method Details
-
setName
Set the name- Parameters:
val- String name
-
getName
Get the name- Returns:
- String name
-
setValue
Set the value- Parameters:
val- String value
-
getValue
Get the value- Returns:
- String value
-
findName
Search the collection for a string that matches the given name.We return the first one we found.
- Parameters:
name-c-- Returns:
- BwProperty or null if no strings.
-
update
Figure out what's different and update it. This should reduce the number of spurious changes to the db.- Parameters:
from-- Returns:
- true if we changed something.
-
checkNulls
public boolean checkNulls()Check this is properly trimmed- Returns:
- boolean true if changed
-
compareTo
- Specified by:
compareToin interfaceComparable<BwProperty>- Overrides:
compareToin classDbItem<BwProperty>
-
hashCode
public int hashCode()- Overrides:
hashCodein classDbItem<BwProperty>
-
toStringSegment
protected void toStringSegment(org.bedework.util.misc.ToString ts) Description copied from class:DbItemAdd our stuff to the StringBuilder- Overrides:
toStringSegmentin classDbItem<BwProperty>- Parameters:
ts- StringBuilder for result
-
toString
-
clone
Description copied from class:DbItemMake visible- Overrides:
clonein classDbItem<BwProperty>- Returns:
- Object of class T
-