com.todoroo.andlib.data
Class Property<TYPE>

java.lang.Object
  extended by com.todoroo.andlib.sql.DBObject<Field>
      extended by com.todoroo.andlib.sql.Field
          extended by com.todoroo.andlib.data.Property<TYPE>
Type Parameters:
TYPE - a database supported type, such as String or Integer
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Property.DoubleProperty, Property.IntegerProperty, Property.LongProperty, Property.StringProperty

public abstract class Property<TYPE>
extends Field
implements java.lang.Cloneable

Property represents a typed column in a database. Within a given database row, the parameter may not exist, in which case the value is null, it may be of an incorrect type, in which case an exception is thrown, or the correct type, in which case the value is returned.

Author:
Tim Su

Nested Class Summary
static class Property.CountProperty
          Counting in aggregated tables.
static class Property.DoubleProperty
          Double property type.
static class Property.IntegerFunctionProperty
          Runs a SQL function and returns the result as a string
static class Property.IntegerProperty
          Integer property type.
static class Property.LongProperty
          Long property type.
static interface Property.PropertyVisitor<RETURN,PARAMETER>
          Visitor interface for property classes
static class Property.StringFunctionProperty
          Runs a SQL function and returns the result as a string
static class Property.StringProperty
          String property type.
 
Field Summary
 java.lang.String name
          The database column name for this property
 Table table
          The database table name this property
 
Method Summary
abstract
<RETURN,PARAMETER>
RETURN
accept(Property.PropertyVisitor<RETURN,PARAMETER> visitor, PARAMETER data)
          Accept a visitor
 Property<TYPE> clone()
          Return a clone of this property
 
Methods inherited from class com.todoroo.andlib.sql.Field
between, eq, eqCaseInsensitive, field, gt, in, in, isNotNull, isNull, like, like, lt, lte, neq
 
Methods inherited from class com.todoroo.andlib.sql.DBObject
as, equals, hasAlias, hashCode, toString, toStringInSelect
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

table

public final Table table
The database table name this property


name

public final java.lang.String name
The database column name for this property

Method Detail

accept

public abstract <RETURN,PARAMETER> RETURN accept(Property.PropertyVisitor<RETURN,PARAMETER> visitor,
                                                 PARAMETER data)
Accept a visitor


clone

public Property<TYPE> clone()
Return a clone of this property

Overrides:
clone in class java.lang.Object