Fix flagsezione
This commit is contained in:
@@ -1,24 +1,56 @@
|
||||
package it.integry.ems.rules.businessLogic.enums;
|
||||
|
||||
public enum FlagSezione {
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public enum FlagSezione implements IBaseEnum<FlagSezione> {
|
||||
RIGHE_INTRA(1),
|
||||
RIGHE_COLLO(2);
|
||||
|
||||
private Integer value;
|
||||
private final Integer value;
|
||||
|
||||
FlagSezione(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static FlagSezione fromValue(Integer value) {
|
||||
public static FlagSezione from(Object value) {
|
||||
Integer castValue;
|
||||
|
||||
if (value instanceof Character)
|
||||
castValue = Integer.parseInt(((Character) value).toString());
|
||||
else if (value instanceof String)
|
||||
castValue = Integer.parseInt((String) value);
|
||||
else
|
||||
castValue = (Integer) value;
|
||||
|
||||
for (FlagSezione flagSezione : FlagSezione.values()) {
|
||||
if (flagSezione.value == value) {
|
||||
if (Objects.equals(flagSezione.value, castValue)) {
|
||||
return flagSezione;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlagSezione fromInternal(Object val) {
|
||||
return from(val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ public class DtbDocr extends DtbBaseDocR implements EquatableEntityInterface<Dtb
|
||||
|
||||
/*Flag_sezione vale 1 per le righe dei riepilogo INTRa, mentre per tutte le altre righe vale null */
|
||||
@SqlField(value = "flag_sezione")
|
||||
private Integer flagSezione;
|
||||
private FlagSezione flagSezione;
|
||||
|
||||
@JsonProperty(value = "pesoNetto")
|
||||
private BigDecimal pesoNetto;
|
||||
@@ -1169,19 +1169,15 @@ public class DtbDocr extends DtbBaseDocR implements EquatableEntityInterface<Dtb
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getFlagSezione() {
|
||||
public FlagSezione getFlagSezione() {
|
||||
return flagSezione;
|
||||
}
|
||||
|
||||
public DtbDocr setFlagSezione(Integer flagSezione) {
|
||||
public DtbDocr setFlagSezione(FlagSezione flagSezione) {
|
||||
this.flagSezione = flagSezione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DtbDocr setFlagSezione (FlagSezione flagSezione) {
|
||||
return setFlagSezione(flagSezione.getValue());
|
||||
}
|
||||
|
||||
public String getReso() {
|
||||
return reso;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user