PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin-module-codegen-engine/src/main/java/com/atlassian/plugins/codegen/modules/common/Conditions.java

https://bitbucket.org/mmeinhold/amps
Java | 47 lines | 35 code | 9 blank | 3 comment | 0 complexity | 23926121d4f447125570e2939f59a88f MD5 | raw file
 1package com.atlassian.plugins.codegen.modules.common;
 2
 3import java.util.ArrayList;
 4import java.util.List;
 5
 6/**
 7 * @since 3.6
 8 */
 9public class Conditions implements Conditional
10{
11    public static final String AND = "AND";
12    public static final String OR = "OR";
13
14    private String type;
15    private List<Conditional> conditions;
16
17    public Conditions(String type)
18    {
19        this.type = type;
20        this.conditions = new ArrayList<Conditional>();
21    }
22
23    public List<Conditional> getConditions()
24    {
25        return conditions;
26    }
27
28    public void addCondition(Conditional condition)
29    {
30        conditions.add(condition);
31    }
32
33    public String getType()
34    {
35        return type;
36    }
37
38    public void setType(String type)
39    {
40        this.type = type;
41    }
42
43    public boolean isEmpty()
44    {
45        return conditions.isEmpty();
46    }
47}