com.atlassian.jira.functest.framework.changehistory
Class ChangeHistorySet

java.lang.Object
  extended by com.atlassian.jira.functest.framework.changehistory.ChangeHistorySet

public class ChangeHistorySet
extends Object

This represents a easier way to test change history. A ChangeHistorySet is a set of ChangeHistoryField objects by a specified user.

Since:
v3.13

Constructor Summary
ChangeHistorySet(ChangeHistoryList changeHistoryList, String changedBy)
           
ChangeHistorySet(ChangeHistorySet changeHistorySet)
          Constructs a new ChangeHistorySet based on an existing one.
 
Method Summary
 ChangeHistorySet add(String fieldName, String newValue)
          A shortcut method to add change history field entries.
 ChangeHistorySet add(String fieldName, String oldValue, String newValue)
          Adds a new ChangeHistoryField to the change history entry.
 boolean equals(Object o)
           
 String getChangedBy()
           
 ChangeHistoryList getContainingChangeHistoryList()
           
 Set getFieldChanges()
           
 int hashCode()
           
 boolean isSuperSetOf(ChangeHistorySet that)
          Returns true if that ChangeHistorySet has the same name and has zero of more fields that occur in this ChangeHistorySet
 Iterator iterator()
           
 ChangeHistoryField lastOf(String fieldName)
          Returns the last ChangeHistoryField with the specified field name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChangeHistorySet

public ChangeHistorySet(ChangeHistoryList changeHistoryList,
                        String changedBy)

ChangeHistorySet

public ChangeHistorySet(ChangeHistorySet changeHistorySet)
Constructs a new ChangeHistorySet based on an existing one.

Parameters:
changeHistorySet - The existing ChangeHistorySet.
Method Detail

getContainingChangeHistoryList

public ChangeHistoryList getContainingChangeHistoryList()

getChangedBy

public String getChangedBy()

getFieldChanges

public Set getFieldChanges()

add

public ChangeHistorySet add(String fieldName,
                            String oldValue,
                            String newValue)
Adds a new ChangeHistoryField to the change history entry. It is a complete field entry with old and new value

Parameters:
fieldName - the name of the field
oldValue - the old value
newValue - the new value
Returns:
this

add

public ChangeHistorySet add(String fieldName,
                            String newValue)
A shortcut method to add change history field entries. This will look back up in the containing ChangeHistoryList and get the previous field values for the named field. It will then use the previous "new value" as the "old value" in this new ChangeHistoryField .

Parameters:
fieldName - the name of the field
newValue - the new value
Returns:
this

lastOf

public ChangeHistoryField lastOf(String fieldName)
Returns the last ChangeHistoryField with the specified field name. Does this by navigating back up the enclosing ChangeHistoryList

Parameters:
fieldName - the name of the field
Returns:
null if it cant be found

iterator

public Iterator iterator()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isSuperSetOf

public boolean isSuperSetOf(ChangeHistorySet that)
Returns true if that ChangeHistorySet has the same name and has zero of more fields that occur in this ChangeHistorySet

Parameters:
that - the other ChangeHistorySet
Returns:
true if we are a super set of that ChangeHistorySet


Copyright © 2002-2012 Atlassian. All Rights Reserved.