com.sonyericsson.hudson.plugins.metadata.model.values
Class DateMetadataValue

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.metadata.model.values.AbstractMetadataValue
      extended by com.sonyericsson.hudson.plugins.metadata.model.values.DateMetadataValue
All Implemented Interfaces:
Metadata<MetadataValue>, MetadataValue, hudson.model.Describable<AbstractMetadataValue>, Serializable, Cloneable, Comparable<Object>

public class DateMetadataValue
extends AbstractMetadataValue

Meta data with the value of a Date.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>
See Also:
Serialized Form

Nested Class Summary
static class DateMetadataValue.DateMetaDataValueDescriptor
          Descriptor for DateMetadataValues.
 
Nested classes/interfaces inherited from class com.sonyericsson.hudson.plugins.metadata.model.values.AbstractMetadataValue
AbstractMetadataValue.AbstractMetaDataValueDescriptor
 
Field Summary
 
Fields inherited from class com.sonyericsson.hudson.plugins.metadata.model.values.AbstractMetadataValue
name
 
Constructor Summary
DateMetadataValue(String name, Date value)
          Standard Constructor.
DateMetadataValue(String name, String description, Date value)
          Standard Constructor.
DateMetadataValue(String name, String description, Date value, boolean exposedToEnvironment)
          Standard Constructor.
DateMetadataValue(String name, String description, int year, int month, int day, TimeDetails details, boolean exposedToEnvironment)
          Standard Constructor.
 
Method Summary
 DateMetadataValue clone()
          Clones this MetadataValue.
 int compareTo(Object userValue)
           
 boolean equals(Object obj)
           
 int getDay()
          Getter for the defaultDay.
 hudson.model.Descriptor<AbstractMetadataValue> getDescriptor()
           
 int getHour()
          Getter for the default hour.
 int getMinute()
          Getter for the default minute.
 int getMonth()
          Getter for the defaultMonth.
 int getSecond()
          Getter for the default second.
 Date getValue()
          Get the value.
 int getYear()
          Getter for the defaultYear.
 int hashCode()
           
 boolean isChecked()
          Returns the checked value, used to decide if the time details should be visible.
 net.sf.json.JSONObject toJson()
          Convert this object into a JSON object.
 
Methods inherited from class com.sonyericsson.hudson.plugins.metadata.model.values.AbstractMetadataValue
addEnvironmentVariables, getDescription, getEnvironmentName, getFullName, getFullName, getFullNameFrom, getFullPath, getName, getParent, isExposedToEnvironment, isGenerated, replacementOf, setDescription, setExposeToEnvironment, setGenerated, setName, setParent, toAbstractJson
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateMetadataValue

@DataBoundConstructor
public DateMetadataValue(String name,
                                              String description,
                                              int year,
                                              int month,
                                              int day,
                                              TimeDetails details,
                                              boolean exposedToEnvironment)
Standard Constructor.

Parameters:
name - the name
year - the default year.
month - the default month of the year.
day - the default day of the month.
description - the description.
details - the optional time details, hour/minute/second.
exposedToEnvironment - if this value should be exposed to the build as an environment variable.

DateMetadataValue

public DateMetadataValue(String name,
                         String description,
                         Date value,
                         boolean exposedToEnvironment)
Standard Constructor.

Parameters:
name - the name.
description - the description.
value - the value.
exposedToEnvironment - if this value should be exposed to the build as an environment variable.

DateMetadataValue

public DateMetadataValue(String name,
                         String description,
                         Date value)
Standard Constructor.

Parameters:
name - the name.
description - the description.
value - the value.

DateMetadataValue

public DateMetadataValue(String name,
                         Date value)
Standard Constructor.

Parameters:
name - the name.
value - the value.
Method Detail

getYear

public int getYear()
Getter for the defaultYear.

Returns:
the default year.

getMonth

public int getMonth()
Getter for the defaultMonth.

Returns:
the default month of the year.

getDay

public int getDay()
Getter for the defaultDay.

Returns:
the default day of the month.

getHour

public int getHour()
Getter for the default hour.

Returns:
the default hour of the day..

getMinute

public int getMinute()
Getter for the default minute.

Returns:
the default minute of the hour.

getSecond

public int getSecond()
Getter for the default second.

Returns:
the default second.

isChecked

public boolean isChecked()
Returns the checked value, used to decide if the time details should be visible.

Returns:
the checked value.

getValue

public Date getValue()
Description copied from class: AbstractMetadataValue
Get the value.

Specified by:
getValue in interface Metadata<MetadataValue>
Overrides:
getValue in class AbstractMetadataValue
Returns:
the value.

getDescriptor

public hudson.model.Descriptor<AbstractMetadataValue> getDescriptor()

toJson

public net.sf.json.JSONObject toJson()
Description copied from interface: MetadataValue
Convert this object into a JSON object.

Returns:
the JSON version.

clone

public DateMetadataValue clone()
                        throws CloneNotSupportedException
Description copied from interface: MetadataValue
Clones this MetadataValue.

Specified by:
clone in interface MetadataValue
Overrides:
clone in class AbstractMetadataValue
Returns:
a clone of this MetadataValue.
Throws:
CloneNotSupportedException - if it cannot be cloned.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object userValue)


Copyright © 2004-2013. All Rights Reserved.