diff options
Diffstat (limited to 'versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/types/Item.java')
-rw-r--r-- | versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/types/Item.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/types/Item.java b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/types/Item.java new file mode 100644 index 0000000..796fc1a --- /dev/null +++ b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/types/Item.java @@ -0,0 +1,55 @@ +/* + * + * Copyright © 2017-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.onap.sdc.common.versioning.services.types; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import lombok.Getter; +import lombok.Setter; + +@Getter +public class Item { + + protected String id; + protected Date creationTime; + protected Date modificationTime; + protected ItemStatus status; + @Setter + private String type; + @Setter + private String name; + @Setter + private String owner; + @Setter + private String description; + private Map<String, Object> properties = new HashMap<>(); + + public boolean isNew() { + return id == null; + } + + public void addProperty(String key, Object value) { + properties.put(key, value); + } + + public <T> T getProperty(String key) { + return (T) properties.get(key); + } +} |