View Javadoc
1   /*
2    * Copyright (c) 2016 ingenieux Labs
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package br.com.ingenieux.mojo.lambda;
18  
19  import com.fasterxml.jackson.databind.node.ObjectNode;
20  
21  import org.apache.commons.lang.builder.CompareToBuilder;
22  
23  import java.io.Serializable;
24  import java.util.ArrayList;
25  import java.util.List;
26  
27  public class LambdaFunctionDefinition implements Serializable, Comparable<LambdaFunctionDefinition> {
28    String name;
29  
30    public String getName() {
31      return name;
32    }
33  
34    public void setName(String name) {
35      this.name = name;
36    }
37  
38    String alias = "";
39  
40    public String getAlias() {
41      return alias;
42    }
43  
44    public void setAlias(String alias) {
45      this.alias = alias;
46    }
47  
48    String description = "";
49  
50    public String getDescription() {
51      return description;
52    }
53  
54    public void setDescription(String description) {
55      this.description = description;
56    }
57  
58    int memorySize;
59  
60    public int getMemorySize() {
61      return memorySize;
62    }
63  
64    public void setMemorySize(int memorySize) {
65      this.memorySize = memorySize;
66    }
67  
68    String role;
69  
70    public String getRole() {
71      return role;
72    }
73  
74    public void setRole(String role) {
75      this.role = role;
76    }
77  
78    int timeout;
79  
80    public int getTimeout() {
81      return timeout;
82    }
83  
84    public void setTimeout(int timeout) {
85      this.timeout = timeout;
86    }
87  
88    String handler;
89  
90    public String getHandler() {
91      return handler;
92    }
93  
94    public void setHandler(String handler) {
95      this.handler = handler;
96    }
97  
98    @Override
99    public int compareTo(LambdaFunctionDefinition o) {
100     if (null == o) return -1;
101 
102     if (this == o) return 0;
103 
104     return new CompareToBuilder().append(this.name, o.name).toComparison();
105   }
106 
107   ObjectNode api;
108 
109   public ObjectNode getApi() {
110     return api;
111   }
112 
113   public void setApi(ObjectNode api) {
114     this.api = api;
115   }
116 
117   List<String> bindings = new ArrayList<>();
118 
119   public List<String> getBindings() {
120     return bindings;
121   }
122 
123   public void setBindings(List<String> bindings) {
124     this.bindings = bindings;
125   }
126 
127   String arn;
128 
129   public String getArn() {
130     return arn;
131   }
132 
133   public void setArn(String arn) {
134     this.arn = arn;
135   }
136 
137   String version;
138 
139   public String getVersion() {
140     return version;
141   }
142 
143   public void setVersion(String version) {
144     this.version = version;
145   }
146 }