1
14
15 package com.liferay.counter.model;
16
17 import java.io.Serializable;
18
19 import java.util.ArrayList;
20 import java.util.List;
21
22
39 public class CounterSoap implements Serializable {
40 public static CounterSoap toSoapModel(Counter model) {
41 CounterSoap soapModel = new CounterSoap();
42
43 soapModel.setName(model.getName());
44 soapModel.setCurrentId(model.getCurrentId());
45
46 return soapModel;
47 }
48
49 public static CounterSoap[] toSoapModels(Counter[] models) {
50 CounterSoap[] soapModels = new CounterSoap[models.length];
51
52 for (int i = 0; i < models.length; i++) {
53 soapModels[i] = toSoapModel(models[i]);
54 }
55
56 return soapModels;
57 }
58
59 public static CounterSoap[][] toSoapModels(Counter[][] models) {
60 CounterSoap[][] soapModels = null;
61
62 if (models.length > 0) {
63 soapModels = new CounterSoap[models.length][models[0].length];
64 }
65 else {
66 soapModels = new CounterSoap[0][0];
67 }
68
69 for (int i = 0; i < models.length; i++) {
70 soapModels[i] = toSoapModels(models[i]);
71 }
72
73 return soapModels;
74 }
75
76 public static CounterSoap[] toSoapModels(List<Counter> models) {
77 List<CounterSoap> soapModels = new ArrayList<CounterSoap>(models.size());
78
79 for (Counter model : models) {
80 soapModels.add(toSoapModel(model));
81 }
82
83 return soapModels.toArray(new CounterSoap[soapModels.size()]);
84 }
85
86 public CounterSoap() {
87 }
88
89 public String getPrimaryKey() {
90 return _name;
91 }
92
93 public void setPrimaryKey(String pk) {
94 setName(pk);
95 }
96
97 public String getName() {
98 return _name;
99 }
100
101 public void setName(String name) {
102 _name = name;
103 }
104
105 public long getCurrentId() {
106 return _currentId;
107 }
108
109 public void setCurrentId(long currentId) {
110 _currentId = currentId;
111 }
112
113 private String _name;
114 private long _currentId;
115 }