org.ujoframework.core
Class UjoPropertyListImpl

java.lang.Object
  extended by org.ujoframework.core.UjoPropertyListImpl
All Implemented Interfaces:
java.lang.Iterable<UjoProperty>, UjoPropertyList

public final class UjoPropertyListImpl
extends java.lang.Object
implements UjoPropertyList

The immutable list of UjoProperties. The UjoPropertyList class is a subset of the methods from class List<UjoProperty>.

Author:
Pavel Ponec

Field Summary
static UjoProperty[] EMPTY
          An empty array of the UJO properties
 int length
          Contains the total count of its properties
 
Constructor Summary
UjoPropertyListImpl()
          Create the empty list
UjoPropertyListImpl(java.util.List<UjoProperty> props)
           
UjoPropertyListImpl(UjoProperty[] props)
           
 
Method Summary
 boolean contains(UjoProperty o)
          Returns true if list contains property from the parameter.
 UjoProperty find(java.lang.String name, boolean throwException)
          Find a property by property name from parameter.
 UjoProperty find(Ujo ujo, java.lang.String name, boolean throwException)
          Find UjoProperty by name
 UjoProperty find(Ujo ujo, java.lang.String name, UjoAction action, boolean result, boolean throwException)
          Find a property by property name from parameter.
 UjoProperty get(int index)
          Get property on requered index
 boolean isEmpty()
          Is the collection empty?
 java.util.Iterator<UjoProperty> iterator()
          Create an interator for all properties.
 UjoProperty last()
          Get last property
 int size()
          Returns a total count of its properties
 UjoProperty[] toArray()
          Returns a copy of internal array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final UjoProperty[] EMPTY
An empty array of the UJO properties


length

public final int length
Contains the total count of its properties

Constructor Detail

UjoPropertyListImpl

public UjoPropertyListImpl(java.util.List<UjoProperty> props)

UjoPropertyListImpl

public UjoPropertyListImpl(UjoProperty[] props)

UjoPropertyListImpl

public UjoPropertyListImpl()
Create the empty list

Method Detail

find

public UjoProperty find(java.lang.String name,
                        boolean throwException)
                 throws java.lang.IllegalArgumentException
Find a property by property name from parameter.

Specified by:
find in interface UjoPropertyList
Parameters:
name - A property name.
throwException - If result not found an Exception is throwed, or a null can be returned.
Returns:
.
Throws:
java.lang.IllegalArgumentException

find

public final UjoProperty find(Ujo ujo,
                              java.lang.String name,
                              boolean throwException)
                       throws java.lang.IllegalArgumentException
Description copied from interface: UjoPropertyList
Find UjoProperty by name

Specified by:
find in interface UjoPropertyList
Throws:
java.lang.IllegalArgumentException

find

public UjoProperty find(Ujo ujo,
                        java.lang.String name,
                        UjoAction action,
                        boolean result,
                        boolean throwException)
                 throws java.lang.IllegalArgumentException
Find a property by property name from parameter.

Specified by:
find in interface UjoPropertyList
Parameters:
ujo - An Ujo object
name - A property name.
action - Action type UjoAction.ACTION_* .
result - Required result of action.
throwException - If result not found an Exception is throwed, or a null can be returned.
Throws:
java.lang.IllegalArgumentException

toArray

public UjoProperty[] toArray()
Returns a copy of internal array

Specified by:
toArray in interface UjoPropertyList

last

public UjoProperty last()
Get last property

Specified by:
last in interface UjoPropertyList

get

public UjoProperty get(int index)
Get property on requered index

Specified by:
get in interface UjoPropertyList

size

public int size()
Returns a total count of its properties

Specified by:
size in interface UjoPropertyList

isEmpty

public boolean isEmpty()
Is the collection empty?

Specified by:
isEmpty in interface UjoPropertyList

contains

public boolean contains(UjoProperty o)
Returns true if list contains property from the parameter.

Specified by:
contains in interface UjoPropertyList

iterator

public java.util.Iterator<UjoProperty> iterator()
Create an interator for all properties.

Specified by:
iterator in interface java.lang.Iterable<UjoProperty>
Specified by:
iterator in interface UjoPropertyList


Copyright © 2009. All Rights Reserved.