org.openpermis.policy
Class ParameterList

java.lang.Object
  extended by org.openpermis.policy.ParameterList
All Implemented Interfaces:
Serializable, Iterable<ParameterList.Parameter>

public final class ParameterList
extends Object
implements Iterable<ParameterList.Parameter>, Serializable

A list of parameters.

See Also:
Serialized Form
Since:
0.1.0

Nested Class Summary
static class ParameterList.Parameter
          A parameter with a name and a type.
 
Constructor Summary
ParameterList()
          Creates an empty parameter list.
 
Method Summary
 void add(String name, Class<?> type)
          Adds a parameter with name and type to the end of the list.
 boolean contains(String name)
          Returns true if a parameter contained in this.
static ParameterList empty()
          An empty parameter list.
 boolean equals(Object obj)
           
 ParameterList getCopy()
           
 String getName(int position)
          Returns the name of parameter at position.
 int getParameterCount()
          Returns the number of parameters.
 Class<?> getType(int position)
          Returns the type of parameter at position.
 Class<?> getType(String name)
          Returns the name of parameter at position.
 int hashCode()
           
 boolean isValid()
          Returns true if this parameter list is valid.
 Iterator<ParameterList.Parameter> iterator()
           
 boolean matchesArguments(List<?> arguments)
          Returns true if arguments matches parameters.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterList

public ParameterList()
Creates an empty parameter list.

Since:
0.1.0
Method Detail

empty

public static final ParameterList empty()
An empty parameter list.

Returns:
a ParameterList without parameters.
Since:
0.1.0

add

public void add(String name,
                Class<?> type)
Adds a parameter with name and type to the end of the list.

Parameters:
name - a name.
type - a type.
Since:
0.1.0

isValid

public boolean isValid()
Returns true if this parameter list is valid.

Returns:
true if this parameter list is valid.
Since:
0.1.0

getName

public String getName(int position)
Returns the name of parameter at position.

Parameters:
position - of the parameter.
Returns:
name the name.
Since:
0.1.0

contains

public boolean contains(String name)
Returns true if a parameter contained in this.

Parameters:
name - a name.
Returns:
true if a parameter contained in this.
Since:
0.1.0

getType

public Class<?> getType(int position)
Returns the type of parameter at position.

Parameters:
position - of the parameter.
Returns:
type the type.
Since:
0.1.0

getType

public Class<?> getType(String name)
Returns the name of parameter at position.

Parameters:
name - of the parameter.
Returns:
type the type.
Since:
0.1.0

getParameterCount

public int getParameterCount()
Returns the number of parameters.

Returns:
the number of parameters.
Since:
0.1.0

matchesArguments

public boolean matchesArguments(List<?> arguments)
Returns true if arguments matches parameters.

Parameters:
arguments - a list of arguments.
Returns:
true if arguments matches parameters.
Since:
0.1.0

iterator

public Iterator<ParameterList.Parameter> iterator()
Specified by:
iterator in interface Iterable<ParameterList.Parameter>
Since:
0.1.0

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Since:
0.1.0

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Since:
0.1.0

getCopy

public ParameterList getCopy()
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:49
Copyright (c) 2002-2007 Ergon Informatik AG