Class BwProperty

All Implemented Interfaces:
Serializable, Comparable<BwProperty>, org.bedework.util.logging.Logged

public class BwProperty extends BwDbentity<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:
  • Constructor Details

    • BwProperty

      public BwProperty()
      Constructor
    • BwProperty

      public BwProperty(String name, String value)
      Create a string by specifying all its fields
      Parameters:
      name - String property name
      value - String value
  • Method Details

    • setName

      public void setName(String val)
      Set the name
      Parameters:
      val - String name
    • getName

      public String getName()
      Get the name
      Returns:
      String name
    • setValue

      public void setValue(String val)
      Set the value
      Parameters:
      val - String value
    • getValue

      public String getValue()
      Get the value
      Returns:
      String value
    • findName

      public static BwProperty findName(String name, Collection<BwProperty> c)
      Search the collection for a string that matches the given name.

      We return the first one we found.

      Parameters:
      name - of property
      c - collection of properties
      Returns:
      BwProperty or null if no strings.
    • update

      public boolean update(BwProperty from)
      Figure out what's different and update it. This should reduce the number of spurious changes to the db.
      Parameters:
      from - BwProperty
      Returns:
      true if we changed something.
    • checkNulls

      public boolean checkNulls()
      Check this is properly trimmed
      Returns:
      boolean true if changed
    • compareTo

      public int compareTo(BwProperty that)
      Specified by:
      compareTo in interface Comparable<BwProperty>
      Overrides:
      compareTo in class BwUnversionedDbentity<BwProperty>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BwUnversionedDbentity<BwProperty>
    • toStringSegment

      protected void toStringSegment(org.bedework.util.misc.ToString ts)
      Description copied from class: BwUnversionedDbentity
      Add our stuff to the ToString object
      Overrides:
      toStringSegment in class BwUnversionedDbentity<BwProperty>
      Parameters:
      ts - ToString for result
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Description copied from class: BwUnversionedDbentity
      Make visible
      Overrides:
      clone in class BwUnversionedDbentity<BwProperty>
      Returns:
      Object of class T