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 byStateFieldannotation.
-
-
Constructor Summary
Constructors Constructor Description RememberState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldfindField(String name)Locates field by name in current class and in superclassesvoidforgetState()Call this method to clear the remembered stateFieldgetField(String name)Locates field by name in current class and in superclasses<T> TgetRememberedState(String fieldName)booleanisFieldModified(Field field)Returns true if specified field was modifiedbooleanisStateModified()Returns true if state of the fields marked withStateFieldannotation has changed.protected StringnormalizeLineFeeds(String str)voidrememberState()Remembers state of fields marked withStateFieldannotation.
-
-
-
Method Detail
-
rememberState
public void rememberState()
Remembers state of fields marked withStateFieldannotation. Objects that implementCloneableinterface as well as some common objects, like String, Integer, Long, List, Map, Set and so on are supported.- Specified by:
rememberStatein 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 withStateFieldannotation has changed.- Specified by:
isStateModifiedin 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)
-
-