jetbrains.buildServer.controllers
Class RememberState

java.lang.Object
  extended by jetbrains.buildServer.controllers.RememberState
All Implemented Interfaces:
StatefulObject
Direct Known Subclasses:
BasePropertiesBean, BuildRunnerBean, BuildTypeForm, VcsSettingsBean

public class RememberState
extends java.lang.Object
implements StatefulObject

An object which is able to track state of its fields and fields of its ancestors marked by StateField annotation.


Constructor Summary
RememberState()
           
 
Method Summary
 java.lang.reflect.Field findField(java.lang.String name)
          Locates field by name in current class and in superclasses
 void forgetState()
          Call this method to clear the remembered state
 boolean isFieldModified(java.lang.reflect.Field field)
          Returns true if specified field was modified
 boolean isStateModified()
          Returns true if state of the fields marked with StateField annotation has changed.
 void rememberState()
          Remembers state of fields marked with StateField annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RememberState

public RememberState()
Method Detail

rememberState

public void rememberState()
Remembers state of fields marked with StateField annotation. Objects that implement Cloneable interface as well as some common objects, like String, Integer, Long, List, Map, Set and so on are supported.

Specified by:
rememberState in interface StatefulObject

forgetState

public void forgetState()
Call this method to clear the remembered state


isStateModified

public boolean isStateModified()
Returns true if state of the fields marked with StateField annotation has changed.

Specified by:
isStateModified in interface StatefulObject
Returns:
true if state has changed

isFieldModified

public boolean isFieldModified(@NotNull
                               java.lang.reflect.Field field)
Returns true if specified field was modified

Parameters:
field - field to check
Returns:
true if field value was modified

findField

@Nullable
public java.lang.reflect.Field findField(@NotNull
                                                  java.lang.String name)
Locates field by name in current class and in superclasses

Parameters:
name - name of the field
Returns:
field or null