com.quamto.jira.data.design.entity.StepsScenarioEntity Maven / Gradle / Ivy
The newest version!
package com.quamto.jira.data.design.entity;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.quamto.entity.BaseEntity;
import com.quamto.jira.data.common.UserMessages;
import com.quamto.jira.data.common.UserMessages.ModuleMessages;
public class StepsScenarioEntity extends BaseEntity {
private long idScenario;
private String description;
private String data;
private long order;
private StepsOwners owner;
/**
* Defines the steps owners
*
* @author jholguin
* @since 03/06/2016
*
*/
public enum StepsOwners{
System(0),
Actor(1);
private final int valueInt;
private final String enumDescription;
private StepsOwners(int value){
UserMessages userMsg = new UserMessages(ModuleMessages.EnumeratorMessages);
this.valueInt = value;
this.enumDescription = userMsg.getEnumeratorDescription(StepsOwners.class.getSimpleName(), this.valueInt);
}
public int getInt(){
return valueInt;
}
public String getDescription(){
return enumDescription;
}
/**
* Returns the value of the enumeration according to the integer sent
* @param value Value to be mapped with respect to enumeration
* @return Value Enumeration value
*/
public StepsOwners getEnumValue(int value){
StepsOwners enumValue = null;
switch (value) {
case 0:
enumValue = StepsOwners.System;
break;
case 1:
enumValue = StepsOwners.Actor;
break;
}
return enumValue;
}
/**
* Gets a Hashmap of the enumeration with the values of the enumeration and description
*
* @return Map of the enumeration values with the respective description of the same
*/
public Map getMapEnumValues(){
Map mapEnum = new HashMap();
for (StepsOwners elmType : StepsOwners.values()) {
mapEnum.put(elmType, elmType.getDescription());
}
return mapEnum;
}
/**
* Gets a list of hashmaps of the enumeration with each enum value, name and description.
* @return List with all of the enum values.
*/
public List> getListEnum(){
List> list = new ArrayList>();
for (StepsOwners elmType : StepsOwners.values()) {
HashMap mapEnum = new HashMap();
mapEnum.put("name", elmType.name() );
mapEnum.put("description", elmType.getDescription() );
list.add(mapEnum);
}
return list;
}
/**
* Gets a Hashmap of the enumeration with int values and each enum name
*
* @return Map with all of the int values and name defined for each enum
*/
public Map getMapIntValuesDescription(){
Map mapEnum = new HashMap();
for (StepsOwners type : StepsOwners.values()) {
mapEnum.put(type.getInt(), type.getDescription());
}
return mapEnum;
}
}
/**
* @return gets the IdStage assigned to kong_pasos_escenarios
*/
public long getIdScenario(){
return this.idScenario;
}
/**
* @param value assigned to kong_pasos_escenarios
*/
public void setIdScenario(long value){
this.idScenario = value;
}
/**
* @return Gets the description assigned to kong_pasos_escenarios
*/
public String getDescription(){
return this.description;
}
/**
* @param value assigned to kong_pasos_escenarios
*/
public void setDescription(String value){
this.description = value;
}
/**
* @return Gets the Data assigned to kong_pasos_escenarios
*/
public String getData(){
return this.data;
}
/**
* @param value assigned to kong_pasos_escenarios
*/
public void setData(String value){
this.data = value;
}
/**
* @return Gets the order assigned to kong_pasos_escenarios
*/
public long getOrder(){
return this.order;
}
/**
* @param value assigned to kong_pasos_escenarios
*/
public void setOrder(long value){
this.order = value;
}
/**
* @return type assigned to the field est_type the table kong_design_stereotypes
*/
public StepsOwners getOwner(){
return this.owner;
}
/**
* @return type assigned to the field est_type the table kong_design_stereotypes
*/
public Integer getOwnerInt(){
return this.owner.getInt();
}
/**
* @return type assigned to the field est_type the table kong_design_stereotypes
*/
public String getOwnerDescription(){
return this.owner.getDescription();
}
/**
* @param value to assign to the field est_type of table kong_design_stereotypes
*/
public void setType(StepsOwners value){
this.owner = value;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy