edu.internet2.middleware.grouper.grouperUi.beans.json
Class GuiOption

java.lang.Object
  extended by edu.internet2.middleware.grouper.grouperUi.beans.json.GuiOption
All Implemented Interfaces:
Serializable

public class GuiOption
extends Object
implements Serializable

option value in a select

See Also:
Serialized Form

Field Summary
static String FIELD_CSS
          name of the javabean property: css
static String FIELD_NAME
          name of the javabean property: name
static String FIELD_VALUE
          name of the javabean property: value
 
Constructor Summary
GuiOption()
          default constructor
GuiOption(String _name, String _value, String _css)
          constructor that includes all fields of bean
 
Method Summary
static void assertContains(List<GuiOption> guiOptions, List<String> keys)
          assert a list contains a option value with a certain key
static void assertContains(List<GuiOption> guiOptions, String key)
          assert a list contains a option value with a certain key
static void assertNotContains(List<GuiOption> guiOptions, List<String> keys)
          assert a list not contains a option value with a certain key
static void assertNotContains(List<GuiOption> guiOptions, String key)
          assert a list not contains a option value with a certain key
static boolean contains(List<GuiOption> guiOptions, String key)
          see if a list contains a key
 String getCss()
          getter for css: css of an option
 String getName()
          getter for name: name of an option
 String getValue()
          getter for value: value of an option
static List<GuiOption> remove(List<GuiOption> guiOptions, List<String> keys, boolean shallowCloneFirst, boolean throwExceptionIfNotThere)
          remove an option value by key.
static List<GuiOption> remove(List<GuiOption> guiOptions, String key, boolean shallowCloneFirst, boolean throwExceptionIfNotThere)
          remove an option value by key.
static List<GuiOption> retainAll(List<GuiOption> guiOptions, List<String> keys, boolean shallowCloneFirst)
          retain only certain options by key.
 void setCss(String _css)
          setter for css: css of an option
 void setName(String _name)
          setter for name: name of an option
 void setValue(String _value)
          setter for value: value of an option
static String toStringForLogging(List<GuiOption> guiOptions)
          print out a few option values
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_NAME

public static final String FIELD_NAME
name of the javabean property: name

See Also:
Constant Field Values

FIELD_VALUE

public static final String FIELD_VALUE
name of the javabean property: value

See Also:
Constant Field Values

FIELD_CSS

public static final String FIELD_CSS
name of the javabean property: css

See Also:
Constant Field Values
Constructor Detail

GuiOption

public GuiOption()
default constructor


GuiOption

public GuiOption(String _name,
                 String _value,
                 String _css)
constructor that includes all fields of bean

Parameters:
_name - name of an option
_value - value of an option
_css - css of an option
Method Detail

setName

public void setName(String _name)
setter for name: name of an option

Parameters:
_name - is the data to set

getName

public String getName()
getter for name: name of an option

Returns:
the value of the field

setValue

public void setValue(String _value)
setter for value: value of an option

Parameters:
_value - is the data to set

getValue

public String getValue()
getter for value: value of an option

Returns:
the value of the field

setCss

public void setCss(String _css)
setter for css: css of an option

Parameters:
_css - is the data to set

getCss

public String getCss()
getter for css: css of an option

Returns:
the value of the field

assertContains

public static void assertContains(List<GuiOption> guiOptions,
                                  List<String> keys)
assert a list contains a option value with a certain key

Parameters:
guiOptions - to search in
keys - key to look for

assertContains

public static void assertContains(List<GuiOption> guiOptions,
                                  String key)
assert a list contains a option value with a certain key

Parameters:
guiOptions - to search in
key - key to look for

assertNotContains

public static void assertNotContains(List<GuiOption> guiOptions,
                                     List<String> keys)
assert a list not contains a option value with a certain key

Parameters:
guiOptions - to search in
keys - key to look for

assertNotContains

public static void assertNotContains(List<GuiOption> guiOptions,
                                     String key)
assert a list not contains a option value with a certain key

Parameters:
guiOptions - to search in
key - key to look for

contains

public static boolean contains(List<GuiOption> guiOptions,
                               String key)
see if a list contains a key

Parameters:
guiOptions -
key -
Returns:
true if it contains

remove

public static List<GuiOption> remove(List<GuiOption> guiOptions,
                                     List<String> keys,
                                     boolean shallowCloneFirst,
                                     boolean throwExceptionIfNotThere)
remove an option value by key.

Parameters:
guiOptions - to remove from
keys - to remove
shallowCloneFirst - true to clone if this is a cached list
throwExceptionIfNotThere - true to throw exception if the element wasnt even there
Returns:
the list (or the same one if not cloning)

remove

public static List<GuiOption> remove(List<GuiOption> guiOptions,
                                     String key,
                                     boolean shallowCloneFirst,
                                     boolean throwExceptionIfNotThere)
remove an option value by key.

Parameters:
guiOptions - to remove from
key - to remove
shallowCloneFirst - true to clone if this is a cached list
throwExceptionIfNotThere - true to throw exception if the element wasnt even there
Returns:
the list (or the same one if not cloning)

retainAll

public static List<GuiOption> retainAll(List<GuiOption> guiOptions,
                                        List<String> keys,
                                        boolean shallowCloneFirst)
retain only certain options by key. Throw exception if not there

Parameters:
guiOptions - to remove from
keys - to remove
shallowCloneFirst - true to clone if this is a cached list
Returns:
the list (or the same one if not cloning)

toStringForLogging

public static String toStringForLogging(List<GuiOption> guiOptions)
print out a few option values

Parameters:
guiOptions -
Returns:
the string value