org.exoplatform.services.jcr.rmi.api.value
Class BooleanValue

java.lang.Object
  extended by org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
      extended by org.exoplatform.services.jcr.rmi.api.value.BooleanValue
All Implemented Interfaces:
java.io.Serializable, javax.jcr.Value, ExtendedValue, StatefulValue

public class BooleanValue
extends BaseNonStreamValue
implements java.io.Serializable, StatefulValue

The BooleanValue class implements the committed value state for Boolean values as a part of the State design pattern (Gof) used by this package.

Since:
0.16.4.1
See Also:
SerialValue, Serialized Form

Field Summary
 
Fields inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
orderNumber
 
Constructor Summary
protected BooleanValue(boolean value)
          Creates an instance for the given boolean value.
protected BooleanValue(java.lang.String value)
          Creates an instance for the given string representation of a boolean.
 
Method Summary
 boolean getBoolean()
          Returns the boolean value.
 long getLength()
           
 int getOrderNumber()
           
 java.lang.String getString()
          Returns the boolean as a string converted by the Boolean.toString(boolean).
 int getType()
          Returns PropertyType.BOOLEAN.
protected static boolean toBoolean(java.lang.String value)
          Returns the boolean value represented by the string value.
 
Methods inherited from class org.exoplatform.services.jcr.rmi.api.value.BaseNonStreamValue
getDate, getDouble, getLong, getReference, getStream, getValueFormatException, setOrderNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exoplatform.services.jcr.core.value.ExtendedValue
getReference, setOrderNumber
 
Methods inherited from interface javax.jcr.Value
getDate, getDouble, getLong, getStream
 

Constructor Detail

BooleanValue

protected BooleanValue(boolean value)
Creates an instance for the given boolean value.


BooleanValue

protected BooleanValue(java.lang.String value)
Creates an instance for the given string representation of a boolean.

Calls toBoolean(String) to convert the string to a boolean.

Method Detail

toBoolean

protected static boolean toBoolean(java.lang.String value)
Returns the boolean value represented by the string value.

This implementation uses the Boolean.valueOf(String) method to convert the string to a boolean.


getType

public int getType()
Returns PropertyType.BOOLEAN.

Specified by:
getType in interface javax.jcr.Value

getBoolean

public boolean getBoolean()
Returns the boolean value.

Specified by:
getBoolean in interface javax.jcr.Value
Overrides:
getBoolean in class BaseNonStreamValue
Returns:
nothing

getString

public java.lang.String getString()
Returns the boolean as a string converted by the Boolean.toString(boolean).

Specified by:
getString in interface javax.jcr.Value

getLength

public long getLength()
Specified by:
getLength in interface ExtendedValue

getOrderNumber

public int getOrderNumber()
Specified by:
getOrderNumber in interface ExtendedValue
Overrides:
getOrderNumber in class BaseNonStreamValue


Copyright © 2010 eXo Platform SAS. All Rights Reserved.