com.silanis.esl.api.model.Model Maven / Gradle / Ivy
The newest version!
package com.silanis.esl.api.model;
//
import java.util.HashSet;
import java.util.Set;
import com.fasterxml.jackson.annotation.*;
@JsonFilter("DirtyFieldsFilter")
public class Model implements java.io.Serializable
{
// Empty Constructor
public Model ( ) {}
@JsonIgnore
private Set dirtyFields = new HashSet();
@JsonIgnore
protected void setDirty(String field) {
dirtyFields.add(field);
}
@JsonIgnore
public boolean isDirty(String field) {
return dirtyFields.contains(field);
}
@JsonIgnore
public Set getDirtyFields() {
return dirtyFields;
}
public void clean() {
dirtyFields.clear();
}
}