Class Properties

java.lang.Object
org.gcube.smartgears.context.Properties
All Implemented Interfaces:
Iterable<Property>

public class Properties extends Object implements Iterable<Property>
A collection of uniquely named Propertys.
Author:
Fabio Simeoni
  • Constructor Details

    • Properties

      public Properties(Properties parent)
      Creates an instance that delegates to another for unknown properties.
      Parameters:
      parent - the parent instance
    • Properties

      public Properties()
      Creates an instance.
  • Method Details

    • iterator

      public Iterator<Property> iterator()
      Specified by:
      iterator in interface Iterable<Property>
    • add

      public void add(Property... properties)
      Adds one or more properties to this collection.
      Parameters:
      properties - the properties
    • contains

      public boolean contains(String name)
      Returns true if this collection contains a given property.
      Parameters:
      name - the name of the property
      Returns:
      true if this collection contains a property with the given name
    • delete

      public void delete(String name)
      Removes a given property.
      Parameters:
      name - the name of the property
      Throws:
      IllegalStateException - if a property with the given name does not exist in this collection
    • lookup

      public Property lookup(String name)
      Returns a given property in this collection.
      Parameters:
      name - the name of the property
      Returns:
      the property
      Throws:
      IllegalStateException - if a property with a given name does not exist in this collection
    • isEmpty

      public boolean isEmpty()
      Returns true if this collection has no properties.
      Returns:
      true if this collection has no properties
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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