Back to project page uppidy-android-sdk.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCT...
If you think the Android project uppidy-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.uppidy.android.sdk.api; // w w w . j a va 2 s. c o m import java.util.Collection; import java.util.Date; import java.util.Map; import org.springframework.util.MultiValueMap; /** * Base class that provides object identity, creation and modification times as * well as means to extend default set of attributes * * @author arudnev@uppidy.com */ public class ApiEntity extends ApiObject { private String ref; private String id; private Date createdTime; private Date updatedTime; private Map<String, String> extra; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRef() { return ref; } public void setRef(String ref) { this.ref = ref; } public Date getCreatedTime() { return createdTime; } public void setCreatedTime(Date createdTime) { this.createdTime = createdTime; } public Date getUpdatedTime() { return updatedTime; } public void setUpdatedTime(Date updatedTime) { this.updatedTime = updatedTime; } public Map<String, String> getExtra() { return extra; } public void setExtra(Map<String, String> extra) { this.extra = extra; } public void copyFromRef(MultiValueMap<String, ApiEntity> map) { if(ref != null && map != null) { copyRefData(map.getFirst(ref)); } } public void copyRefData(ApiEntity other) { if(other != null) { this.id = other.id; this.createdTime = other.createdTime; this.updatedTime = other.updatedTime; this.ref = other.ref; } } public static void copyFromRefs(Collection<? extends ApiEntity> entities, MultiValueMap<String, ApiEntity> map) { if(entities != null && map != null) { for(ApiEntity entity : entities) { entity.copyFromRef(map); } } } }