Class IntProperty

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, IBasicStoreableObject, IPlainDataObject

    public class IntProperty
    extends Property
    This class represents an integer property (the mapping for int or integer attributes)
    Since:
    1.0
    Version:
    $Id: $Id
    Author:
    another
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      IntProperty​(java.lang.String name, int value)
      Creates a new IntProperty with given name and value.
      IntProperty​(java.lang.String name, java.lang.Integer value)
      Creates a new IntProperty with given name and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object cloneValue()
      cloneValue.
      int getInt()
      Returns the value of this property as int.
      java.lang.Integer getInteger()
      Returns the value of this property as Integer object.
      PropertyType getPropertyType()
      getPropertyType.
      long getSizeInBytes()
      The 'size' of a DataHolder is needed for the quota calculation.
      The size of an atomic DataHolder like a Property should be the real amount of bytes it uses, whether the size of complex objects should be cumulated.
      The overhead for administration shouldn't be counted (i.e.
      void setInt​(int aValue)
      Sets the value of this property to the given int value.
      void setInteger​(java.lang.Integer aValue)
      Sets the value of this property to the given Integer value.
      void setValue​(java.lang.Object o)
      Sets the value of this Property.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IntProperty

        public IntProperty​(java.lang.String name,
                           int value)
        Creates a new IntProperty with given name and value.
        Parameters:
        name - a String object.
        value - a int.
      • IntProperty

        public IntProperty​(java.lang.String name,
                           java.lang.Integer value)
        Creates a new IntProperty with given name and value.
        Parameters:
        name - a String object.
        value - a Integer object.
    • Method Detail

      • getInteger

        public java.lang.Integer getInteger()
        Returns the value of this property as Integer object.
        Returns:
        a Integer object.
      • getInt

        public int getInt()
        Returns the value of this property as int.
        Returns:
        a int.
      • setInt

        public void setInt​(int aValue)
        Sets the value of this property to the given int value.
        Parameters:
        aValue - a int.
      • setInteger

        public void setInteger​(java.lang.Integer aValue)
        Sets the value of this property to the given Integer value.
        Parameters:
        aValue - a Integer object.
      • setValue

        public void setValue​(java.lang.Object o)
        Sets the value of this Property. Sets the value of this property to the value of the given object. o can be an Integer or a String representing an integer.
        Overrides:
        setValue in class Property
        Parameters:
        o - object to set
      • getSizeInBytes

        public long getSizeInBytes()
        The 'size' of a DataHolder is needed for the quota calculation.
        The size of an atomic DataHolder like a Property should be the real amount of bytes it uses, whether the size of complex objects should be cumulated.
        The overhead for administration shouldn't be counted (i.e. the size of an IntProperty is the amount of bytes needed to store the int value itself, not the amount of bytes needed to store the DataHolder object). Returns the amount of bytes needed to hold an integer value - 4.
        Specified by:
        getSizeInBytes in class DataHolder
        Returns:
        a long.
      • cloneValue

        protected java.lang.Object cloneValue()

        cloneValue.

        Specified by:
        cloneValue in class Property
        Returns:
        a Object object.