Merge branch 'master' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-02-25 15:37:02 +01:00

View File

@@ -422,9 +422,10 @@ public class AtbOfft extends EntityBase {
atbOffr.deleteAllEntities(connection, this);
}
public enum StatoOfferta implements IBaseEnum {
RICHIESTA_DI_OFFERTA(0), OFFERTA(1), CONTRATTO(2);
public enum StatoOfferta implements IBaseEnum<StatoOfferta> {
RICHIESTA_DI_OFFERTA(0),
OFFERTA(1),
CONTRATTO(2);
private final int value;
@@ -432,6 +433,23 @@ public class AtbOfft extends EntityBase {
this.value = value;
}
public static StatoOfferta from(Object value) {
int castValue;
if (value instanceof String) {
castValue = Integer.parseInt(value.toString());
} else {
castValue = (int) value;
}
for (StatoOfferta b : StatoOfferta.values()) {
if (b.value == castValue)
return b;
}
return null;
}
@JsonValue
public int getValue() {
return value;
@@ -443,27 +461,13 @@ public class AtbOfft extends EntityBase {
}
@Override
public Object fromInternal(Object val) {
public StatoOfferta fromInternal(Object val) {
return from(val);
}
public static AtbOfft.StatoOfferta fromValue(int value) {
for (AtbOfft.StatoOfferta statoOfferta : AtbOfft.StatoOfferta.values()) {
if (statoOfferta.value == value) {
return statoOfferta;
}
}
return null;
}
public static AtbOfft.StatoOfferta from(Object value) {
int castValue = (int) value;
for (AtbOfft.StatoOfferta statoOfferta : AtbOfft.StatoOfferta.values()) {
if (statoOfferta.value == castValue) {
return statoOfferta;
}
}
return null;
@Override
public String toString() {
return String.valueOf(value);
}
}
}