Class RememberState
- java.lang.Object
-
- jetbrains.buildServer.controllers.RememberState
-
- All Implemented Interfaces:
StatefulObject
- Direct Known Subclasses:
AbstractProperty
,AuthAdminBean
,BaseProjectForm
,BasePropertiesBean
,BuildRunnerBean
,BuildTypeOptionsForm
,EditGroupBean
,NewUserForm
,NotificatorPluginSection
,ParameterSpecForm
,PasswordFieldParameterType.State
,ServerConfigForm
,VcsPropertiesBean
,VisibleBuildTypesBean
,VisibleProjectsBean
public class RememberState extends Object implements StatefulObject
An object which is able to track state of its fields and fields of its ancestors marked byStateField
annotation.
-
-
Constructor Summary
Constructors Constructor Description RememberState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Field
findField(String name)
Locates field by name in current class and in superclassesvoid
forgetState()
Call this method to clear the remembered stateField
getField(String name)
Locates field by name in current class and in superclasses<T> T
getRememberedState(String fieldName)
boolean
isFieldModified(Field field)
Returns true if specified field was modifiedboolean
isStateModified()
Returns true if state of the fields marked withStateField
annotation has changed.protected String
normalizeLineFeeds(String str)
void
rememberState()
Remembers state of fields marked withStateField
annotation.
-
-
-
Method Detail
-
rememberState
public void rememberState()
Remembers state of fields marked withStateField
annotation. Objects that implementCloneable
interface as well as some common objects, like String, Integer, Long, List, Map, Set and so on are supported.- Specified by:
rememberState
in interfaceStatefulObject
-
forgetState
public void forgetState()
Call this method to clear the remembered state
-
isStateModified
public boolean isStateModified()
Returns true if state of the fields marked withStateField
annotation has changed.- Specified by:
isStateModified
in interfaceStatefulObject
- Returns:
- true if state has changed
-
isFieldModified
public boolean isFieldModified(@NotNull Field field)
Returns true if specified field was modified- Parameters:
field
- field to check- Returns:
- true if field value was modified
-
findField
@Nullable public Field findField(@NotNull String name)
Locates field by name in current class and in superclasses- Parameters:
name
- name of the field- Returns:
- field or null
-
getField
@NotNull public Field getField(@NotNull String name)
Locates field by name in current class and in superclasses- Parameters:
name
- name of the field- Since:
- 10.0
-
getRememberedState
public <T> T getRememberedState(@NotNull String fieldName)
-
-