RM-4396: Experiment using lombok to remove boiler plate code

This commit is contained in:
Tuna Aksoy
2016-11-28 21:20:11 +00:00
parent 6482c51703
commit d968624c2f
9 changed files with 172 additions and 512 deletions

View File

@@ -34,6 +34,11 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* POJO for file plan component
*
@@ -41,6 +46,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author Rodica Sutu
* @since 2.6
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FilePlanComponent
{
@JsonProperty (required = true)
@@ -94,325 +103,4 @@ public class FilePlanComponent
@JsonProperty (required = true)
private FilePlanComponentUserInfo modifiedByUser;
/**Helper constructor for creating the file plan component using
*
* @param name File Plan Component name
* @param nodeType File Plan Component node type
* @param properties File Plan Component properties
*/
public FilePlanComponent(String name, String nodeType, FilePlanComponentProperties properties)
{
this.name = name;
this.nodeType = nodeType;
this.properties = properties;
}
/**
* Helper constructor to create empty file plan component
*/
public FilePlanComponent() { }
/**
* Helper constructor for creating the file plan component using
*
* @param name File Plan Component name
*/
public FilePlanComponent(String name)
{
this.name = name;
}
/**
* Helper constructor for creating the file plan component using
*
* @param name File Plan Component name
* @param properties File Plan Component properties
*/
public FilePlanComponent(String name, FilePlanComponentProperties properties)
{
this.name = name;
this.properties = properties;
}
/**
* @return the id
*/
public String getId()
{
return this.id;
}
/**
* @param id the id to set
*/
public void setId(String id)
{
this.id = id;
}
/**
* @return the parentId
*/
public String getParentId()
{
return this.parentId;
}
/**
* @param parentId the parentId to set
*/
public void setParentId(String parentId)
{
this.parentId = parentId;
}
/**
* @return the name
*/
public String getName()
{
return this.name;
}
/**
* @param name the name to set
*/
public void setName(String name)
{
this.name = name;
}
/**
* @return the nodeType
*/
public String getNodeType()
{
return this.nodeType;
}
/**
* @param nodeType the nodeType to set
*/
public void setNodeType(String nodeType)
{
this.nodeType = nodeType;
}
/**
* @return the isCategory
*/
public Boolean isIsCategory()
{
return this.isCategory;
}
/**
* @param isCategory the isCategory to set
*/
public void setCategory(Boolean isCategory)
{
this.isCategory = isCategory;
}
/**
* @return the isRecordFolder
*/
public Boolean isIsRecordFolder()
{
return this.isRecordFolder;
}
/**
* @param isRecordFolder the isRecordFolder to set
*/
public void setRecordFolder(Boolean isRecordFolder)
{
this.isRecordFolder = isRecordFolder;
}
/**
* @return the isFile
*/
public Boolean isIsFile()
{
return this.isFile;
}
/**
* @param isFile the isFile to set
*/
public void setFile(Boolean isFile)
{
this.isFile = isFile;
}
/**
* @return the hasRetentionSchedule
*/
public Boolean isHasRetentionSchedule()
{
return this.hasRetentionSchedule;
}
/**
* @param hasRetentionSchedule the hasRetentionSchedule to set
*/
public void setHasRetentionSchedule(Boolean hasRetentionSchedule)
{
this.hasRetentionSchedule = hasRetentionSchedule;
}
/**
* @return the properties
*/
public FilePlanComponentProperties getProperties()
{
return properties;
}
/**
* @param properties the properties to set
*/
public void setProperties(FilePlanComponentProperties properties)
{
this.properties = properties;
}
/**
* @return the aspectNames
*/
public List<String> getAspectNames()
{
return this.aspectNames;
}
/**
* @param aspectNames the aspectNames to set
*/
public void setAspectNames(List<String> aspectNames)
{
this.aspectNames = aspectNames;
}
/**
* @return the createdByUser
*/
public FilePlanComponentUserInfo getCreatedByUser()
{
return this.createdByUser;
}
/**
* @param createdByUser the createdByUser to set
*/
public void setCreatedByUser(FilePlanComponentUserInfo createdByUser)
{
this.createdByUser = createdByUser;
}
/**
* @return the allowableOperations
*/
public List<String> getAllowableOperations()
{
return this.allowableOperations;
}
/**
* @return the path
*/
public FilePlanComponentPath getPath()
{
return this.path;
}
/**
* @param path the path to set
*/
public void setPath(FilePlanComponentPath path)
{
this.path = path;
}
/**
* @param modifiedAt the modifiedAt to set
*/
public void setModifiedAt(String modifiedAt)
{
this.modifiedAt = modifiedAt;
}
/**
* @param createdAt the createdAt to set
*/
public void setCreatedAt(String createdAt)
{
this.createdAt = createdAt;
}
/**
* @param modifiedByUser the modifiedByUser to set
*/
public void setModifiedByUser(FilePlanComponentUserInfo modifiedByUser)
{
this.modifiedByUser = modifiedByUser;
}
/**
* @return the modifiedAt
*/
public String getModifiedAt()
{
return this.modifiedAt;
}
/**
* @return the createdAt
*/
public String getCreatedAt()
{
return this.createdAt;
}
/**
* @return the modifiedByUser
*/
public FilePlanComponentUserInfo getModifiedByUser()
{
return this.modifiedByUser;
}
/**
* @return the isClosed
*/
public Boolean isClosed()
{
return this.isClosed;
}
/**
* @param closed the isClosed to set
*/
public void setClosed(Boolean closed)
{
this.isClosed = closed;
}
/**
* @return the isCompleted
*/
public Boolean isCompleted()
{
return this.isCompleted;
}
/**
* @param completed the isCompleted to set
*/
public void setCompleted(Boolean completed)
{
this.isCompleted = completed;
}
}

View File

@@ -42,6 +42,11 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* POJO for file plan component properties
*
@@ -50,6 +55,10 @@ import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
*/
//FIXME: Once the fields have been added the JsonIgnoreProperties annotation should be removed
@JsonIgnoreProperties (ignoreUnknown = true)
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FilePlanComponentProperties
{
@@ -74,133 +83,4 @@ public class FilePlanComponentProperties
@JsonProperty(PROPERTIES_LOCATION)
private String location;
public FilePlanComponentProperties(String title, String description)
{
this.title = title;
this.description = description;
}
public FilePlanComponentProperties(String title)
{
this.title = title;
}
public FilePlanComponentProperties()
{
}
/**
* @return the vitalRecord
*/
public Boolean isVitalRecord()
{
return this.vitalRecord;
}
/**
* @param vitalRecord the vitalRecord to set
*/
public void setVitalRecord(Boolean vitalRecord)
{
this.vitalRecord = vitalRecord;
}
/**
* @return the title
*/
public String getTitle()
{
return this.title;
}
/**
* @param title the title to set
*/
public void setTitle(String title)
{
this.title = title;
}
/**
* @return the holdReason
*/
public String getHoldReason()
{
return this.holdReason;
}
/**
* @param holdReason the holdReason to set
*/
public void setHoldReason(String holdReason)
{
this.holdReason = holdReason;
}
/**
* @param description the description to set
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @return the description
*/
public String getDescription()
{
return this.description;
}
/**
* @return the supplementalMarkingList
*/
public List<String> getSupplementalMarkingList()
{
return this.supplementalMarkingList;
}
/**
* @param supplementalMarkingList the supplementalMarkingList to set
*/
public void setSupplementalMarkingList(List<String> supplementalMarkingList)
{
this.supplementalMarkingList = supplementalMarkingList;
}
/**
* @return the reviewPeriod
*/
public ReviewPeriod getReviewPeriod()
{
return reviewPeriod;
}
/**
* @param reviewPeriod the reviewPeriod to set
*/
public void setReviewPeriod(ReviewPeriod reviewPeriod)
{
this.reviewPeriod = reviewPeriod;
}
/**
* @return the location
*/
public String getLocation()
{
return location;
}
/**
* @param location the location to set
*/
public void setLocation(String location)
{
this.location = location;
}
}