001
014
015 package com.liferay.portal.model;
016
017 import java.io.Serializable;
018
019 import java.util.ArrayList;
020 import java.util.List;
021
022
029 public class ResourceSoap implements Serializable {
030 public static ResourceSoap toSoapModel(Resource model) {
031 ResourceSoap soapModel = new ResourceSoap();
032
033 soapModel.setResourceId(model.getResourceId());
034 soapModel.setCodeId(model.getCodeId());
035 soapModel.setPrimKey(model.getPrimKey());
036
037 return soapModel;
038 }
039
040 public static ResourceSoap[] toSoapModels(Resource[] models) {
041 ResourceSoap[] soapModels = new ResourceSoap[models.length];
042
043 for (int i = 0; i < models.length; i++) {
044 soapModels[i] = toSoapModel(models[i]);
045 }
046
047 return soapModels;
048 }
049
050 public static ResourceSoap[][] toSoapModels(Resource[][] models) {
051 ResourceSoap[][] soapModels = null;
052
053 if (models.length > 0) {
054 soapModels = new ResourceSoap[models.length][models[0].length];
055 }
056 else {
057 soapModels = new ResourceSoap[0][0];
058 }
059
060 for (int i = 0; i < models.length; i++) {
061 soapModels[i] = toSoapModels(models[i]);
062 }
063
064 return soapModels;
065 }
066
067 public static ResourceSoap[] toSoapModels(List<Resource> models) {
068 List<ResourceSoap> soapModels = new ArrayList<ResourceSoap>(models.size());
069
070 for (Resource model : models) {
071 soapModels.add(toSoapModel(model));
072 }
073
074 return soapModels.toArray(new ResourceSoap[soapModels.size()]);
075 }
076
077 public ResourceSoap() {
078 }
079
080 public long getPrimaryKey() {
081 return _resourceId;
082 }
083
084 public void setPrimaryKey(long pk) {
085 setResourceId(pk);
086 }
087
088 public long getResourceId() {
089 return _resourceId;
090 }
091
092 public void setResourceId(long resourceId) {
093 _resourceId = resourceId;
094 }
095
096 public long getCodeId() {
097 return _codeId;
098 }
099
100 public void setCodeId(long codeId) {
101 _codeId = codeId;
102 }
103
104 public String getPrimKey() {
105 return _primKey;
106 }
107
108 public void setPrimKey(String primKey) {
109 _primKey = primKey;
110 }
111
112 private long _resourceId;
113 private long _codeId;
114 private String _primKey;
115 }