org.ujoframework.extensions
Interface ListUjoProperty<UJO extends Ujo,ITEM>

All Superinterfaces:
java.lang.CharSequence, UjoProperty<UJO,java.util.List<ITEM>>
All Known Implementing Classes:
BeanPropertyList, FieldPropertyList, ListProperty

public interface ListUjoProperty<UJO extends Ujo,ITEM>
extends UjoProperty<UJO,java.util.List<ITEM>>

A property list metadata of Unified Data Object.

Author:
Pavel Ponec

Method Summary
 boolean addItem(UJO ujo, ITEM value)
          Add an Item Value.
 ITEM getItem(UJO ujo, int index)
          Returns a value of property.
 int getItemCount(UJO ujo)
          Returns a count of Items.
 java.lang.Class<ITEM> getItemType()
          Returns a class of the property.
 java.util.List<ITEM> getList(UJO ujo)
          Return a not null List.
 boolean isDefault(UJO ujo)
          Indicates whether a list of items is null or empty.
 boolean isItemTypeOf(java.lang.Class type)
          Returns true if the item type is a type or subtype of the parameter class.
 boolean removeItem(UJO ujo, ITEM value)
          Removes the first occurrence in this list of the specified element.
 ITEM setItem(UJO ujo, int index, ITEM value)
          Set a property item value.
 
Methods inherited from interface org.ujoframework.UjoProperty
add, copy, descending, equals, getDefault, getIndex, getName, getType, getValue, isAscending, isDirect, isTypeOf, of, setValue, toString
 
Methods inherited from interface java.lang.CharSequence
charAt, length, subSequence
 

Method Detail

getItemType

java.lang.Class<ITEM> getItemType()
Returns a class of the property.


getItemCount

int getItemCount(UJO ujo)
Returns a count of Items. If the property is null, method returns 0.


isItemTypeOf

boolean isItemTypeOf(java.lang.Class type)
Returns true if the item type is a type or subtype of the parameter class.


getItem

ITEM getItem(UJO ujo,
             int index)
Returns a value of property. The result is the same, like Ujo#readValue(ListUjoPropertyCommon).


getList

java.util.List<ITEM> getList(UJO ujo)
Return a not null List. If original list value is empty, the new List is created.

See Also:
getItem(Ujo, int)

setItem

ITEM setItem(UJO ujo,
             int index,
             ITEM value)
Set a property item value.

Returns:
the element previously at the specified position.

addItem

boolean addItem(UJO ujo,
                ITEM value)
Add an Item Value. If List is null, the method create an instance of List (for exact behaviour see an implementation).

Returns:
true (as per the general contract of Collection.add).

removeItem

boolean removeItem(UJO ujo,
                   ITEM value)
Removes the first occurrence in this list of the specified element.

Returns:
true if this list is not null and contains the specified element, otherwise returns false.
Since:
0.81

isDefault

boolean isDefault(UJO ujo)
Indicates whether a list of items is null or empty.

Specified by:
isDefault in interface UjoProperty<UJO extends Ujo,java.util.List<ITEM>>


Copyright © 2010. All Rights Reserved.