65 lines
1.1 KiB
Java
Executable File
65 lines
1.1 KiB
Java
Executable File
package tk.artikus.assets.thymeleaf;
|
|
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
|
|
import lombok.Data;
|
|
import tk.artikus.assets.Asset;
|
|
import tk.artikus.assets.AssetDepreciationMethod;
|
|
import tk.artikus.assets.AssetLifeChange;
|
|
|
|
@Data
|
|
public class ThAsset {
|
|
|
|
Asset asset;
|
|
|
|
public ThAsset(Asset asset) {
|
|
this.asset = asset;
|
|
}
|
|
|
|
public ThAsset() {
|
|
this( new Asset() );
|
|
}
|
|
|
|
public boolean isNew() {
|
|
return asset.getInventoryNumber() == null;
|
|
}
|
|
|
|
public Asset toDomainObject() {
|
|
|
|
return asset;
|
|
}
|
|
|
|
|
|
public String getId() {
|
|
return asset.getInventoryNumber();
|
|
}
|
|
|
|
public void setId( String assetId ) {
|
|
asset.setInventoryNumber( assetId );
|
|
}
|
|
|
|
public String getInventoryNumber() {
|
|
return asset.getInventoryNumber();
|
|
}
|
|
public void setInventoryNumber(String inventoryNumber) {
|
|
asset.setInventoryNumber( inventoryNumber );
|
|
}
|
|
|
|
public String getKst() {
|
|
return asset.getKst();
|
|
}
|
|
|
|
public void setKst(String kst ) {
|
|
asset.setKst( kst );
|
|
}
|
|
public List<AssetLifeChange> getLife() {
|
|
return asset.getLife().getChanges();
|
|
}
|
|
|
|
public Collection<AssetDepreciationMethod> getMethods() {
|
|
return asset.getDepreciationMethods().values();
|
|
}
|
|
|
|
}
|