Skip to content

Commit

Permalink
Merge pull request Azure#533 from christav/dev
Browse files Browse the repository at this point in the history
Make Info types immutable
  • Loading branch information
Chris Tavares committed Dec 11, 2012
2 parents 9bb2390 + ee834b2 commit c85b1e7
Show file tree
Hide file tree
Showing 15 changed files with 173 additions and 930 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ public String getId() {
* @param id
* the id to set
*/
public void setId(String id) {
public AssetType setId(String id) {
this.id = id;
return this;
}

/**
Expand All @@ -76,8 +77,9 @@ public Integer getState() {
* @param state
* the state to set
*/
public void setState(Integer state) {
public AssetType setState(Integer state) {
this.state = state;
return this;
}

/**
Expand All @@ -91,8 +93,9 @@ public Date getCreated() {
* @param created
* the created to set
*/
public void setCreated(Date created) {
public AssetType setCreated(Date created) {
this.created = created;
return this;
}

/**
Expand All @@ -106,8 +109,9 @@ public Date getLastModified() {
* @param lastModified
* the lastModified to set
*/
public void setLastModified(Date lastModified) {
public AssetType setLastModified(Date lastModified) {
this.lastModified = lastModified;
return this;
}

/**
Expand All @@ -121,8 +125,9 @@ public String getAlternateId() {
* @param alternateId
* the alternateId to set
*/
public void setAlternateId(String alternateId) {
public AssetType setAlternateId(String alternateId) {
this.alternateId = alternateId;
return this;
}

/**
Expand All @@ -136,8 +141,9 @@ public String getName() {
* @param name
* the name to set
*/
public void setName(String name) {
public AssetType setName(String name) {
this.name = name;
return this;
}

/**
Expand All @@ -151,7 +157,8 @@ public Integer getOptions() {
* @param options
* the options to set
*/
public void setOptions(Integer options) {
public AssetType setOptions(Integer options) {
this.options = options;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ public String getId() {
* @param id
* the id to set
*/
public void setId(String id) {
public MediaProcessorType setId(String id) {
this.id = id;
return this;
}

/**
Expand All @@ -71,39 +72,44 @@ public String getName() {
* @param name
* the name to set
*/
public void setName(String name) {
public MediaProcessorType setName(String name) {
this.name = name;
return this;
}

public String getDescription() {
return this.description;
}

public void setDescription(String description) {
public MediaProcessorType setDescription(String description) {
this.description = description;
return this;
}

public String getSku() {
return this.sku;
}

public void setSku(String sku) {
public MediaProcessorType setSku(String sku) {
this.sku = sku;
return this;
}

public String getVendor() {
return vendor;
}

public void setVendor(String vendor) {
public MediaProcessorType setVendor(String vendor) {
this.vendor = vendor;
return this;
}

public String getVersion() {
return this.version;
}

public void setVersion(String version) {
public MediaProcessorType setVersion(String version) {
this.version = version;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,67 +22,76 @@
import com.microsoft.windowsazure.services.media.implementation.atom.EntryType;
import com.microsoft.windowsazure.services.media.implementation.content.AccessPolicyType;

/**
* Type containing data about access policies.
*
*/
public class AccessPolicyInfo extends ODataEntity<AccessPolicyType> {

/**
* Creates a new {@link AccessPolicyInfo} wrapping the given ATOM
* entry and content objects.
*
* @param entry
* Entry containing this AccessPolicy data
* @param content
* Content with the AccessPolicy data
*/
public AccessPolicyInfo(EntryType entry, AccessPolicyType content) {
super(entry, content);
}

public AccessPolicyInfo() {
super(new AccessPolicyType());
}

/**
* Get the access policy id.
*
* @return the id.
*/
public String getId() {
return getContent().getId();
}

public AccessPolicyInfo setId(String id) {
getContent().setId(id);
return this;
}

/**
* Get the creation date.
*
* @return the date.
*/
public Date getCreated() {
return getContent().getCreated();
}

public AccessPolicyInfo setCreated(Date created) {
getContent().setCreated(created);
return this;
}

/**
* Get the last modified date.
*
* @return the date.
*/
public Date getLastModified() {
return getContent().getLastModified();
}

public AccessPolicyInfo setLastModified(Date lastModified) {
getContent().setLastModified(lastModified);
return this;
}

/**
* Get the name.
*
* @return the name.
*/
public String getName() {
return getContent().getName();
}

public AccessPolicyInfo setName(String name) {
getContent().setName(name);
return this;
}

/**
* Get the duration.
*
* @return the duration.
*/
public double getDurationInMinutes() {
return getContent().getDurationInMinutes();
}

public AccessPolicyInfo setDurationInMinutes(double durationInMinutes) {
getContent().setDurationInMinutes(durationInMinutes);
return this;
}

/**
* Get the permissions.
*
* @return the permissions.
*/
public EnumSet<AccessPolicyPermission> getPermissions() {
return AccessPolicyPermission.permissionsFromBits(getContent().getPermissions());
}

public AccessPolicyInfo setPermissions(EnumSet<AccessPolicyPermission> permissions) {
getContent().setPermissions(AccessPolicyPermission.bitsFromPermissions(permissions));
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ public AssetInfo(EntryType entry, AssetType content) {
super(entry, content);
}

/**
* Instantiates a new asset info.
*/
public AssetInfo() {
super(new AssetType());
}

/**
* Get the asset id.
*
Expand All @@ -55,18 +48,6 @@ public String getId() {
return getContent().getId();
}

/**
* Set the id.
*
* @param id
* the id
* @return the asset info
*/
public AssetInfo setId(String id) {
getContent().setId(id);
return this;
}

/**
* Get the asset name.
*
Expand All @@ -76,18 +57,6 @@ public String getName() {
return this.getContent().getName();
}

/**
* set the name.
*
* @param name
* the name
* @return the asset info
*/
public AssetInfo setName(String name) {
this.getContent().setName(name);
return this;
}

/**
* Get the asset state.
*
Expand All @@ -97,18 +66,6 @@ public AssetState getState() {
return AssetState.fromCode(getContent().getState());
}

/**
* Set the state.
*
* @param state
* the state
* @return the asset info
*/
public AssetInfo setState(AssetState state) {
getContent().setState(state.getCode());
return this;
}

/**
* Get the creation date.
*
Expand All @@ -118,18 +75,6 @@ public Date getCreated() {
return this.getContent().getCreated();
}

/**
* Set creation date.
*
* @param created
* the date
* @return the asset info
*/
public AssetInfo setCreated(Date created) {
getContent().setCreated(created);
return this;
}

/**
* Get last modified date.
*
Expand All @@ -139,18 +84,6 @@ public Date getLastModified() {
return getContent().getLastModified();
}

/**
* Set last modified date.
*
* @param lastModified
* the date
* @return the asset info
*/
public AssetInfo setLastModified(Date lastModified) {
getContent().setLastModified(lastModified);
return this;
}

/**
* Get the alternate id.
*
Expand All @@ -160,18 +93,6 @@ public String getAlternateId() {
return getContent().getAlternateId();
}

/**
* Set the alternate id.
*
* @param alternateId
* the id
* @return the asset info
*/
public AssetInfo setAlternateId(String alternateId) {
getContent().setAlternateId(alternateId);
return this;
}

/**
* Get the options.
*
Expand All @@ -180,17 +101,4 @@ public AssetInfo setAlternateId(String alternateId) {
public EncryptionOption getOptions() {
return EncryptionOption.fromCode(getContent().getOptions());
}

/**
* Set the options.
*
* @param encryptionOption
* the encryption option
* @return the asset info
*/
public AssetInfo setOptions(EncryptionOption encryptionOption) {
getContent().setOptions(encryptionOption.getCode());
return this;
}

}
Loading

0 comments on commit c85b1e7

Please sign in to comment.