Changeset 87 for java/main/src/main/java/com/framsticks/params/Param.java
- Timestamp:
- 06/28/13 11:56:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/Param.java
r86 r87 2 2 3 3 4 import com.framsticks.params.types.DecimalParam; 5 import com.framsticks.params.types.StringParam; 4 import javax.annotation.concurrent.Immutable; 5 6 import com.framsticks.params.annotations.FramsClassAnnotation; 7 import com.framsticks.params.annotations.ParamAnnotation; 6 8 7 9 /** … … 14 16 * @author Piotr Śniegowski 15 17 */ 18 @Immutable 19 @FramsClassAnnotation(id = "prop", name = "prop") 16 20 public abstract class Param { 17 21 18 22 /** The parameter id. */ 19 protected String id;23 protected final String id; 20 24 25 //TODO 21 26 /** 22 27 * The parameter internal id. It's set by a user to use user's own getId in 23 28 * code 24 29 */ 25 protected String internalId;30 protected final String internalId; 26 31 27 32 /** The parameter name. */ 28 protected String name;33 protected final String name; 29 34 30 35 /** The help (description) concerning parameter. */ 31 protected String help;36 protected final String help; 32 37 33 38 /** The number of group, that parameter belongs to. */ 34 protected Integer group;39 protected final Integer group; 35 40 36 41 /** The getFlags stored as a bit sum. */ 37 protected Integer flags;42 protected final Integer flags; 38 43 44 //TODO 39 45 /** The variable determining whether the parameter is an extra parameter. */ 40 protected Integer extra;46 protected final Integer extra; 41 47 42 43 public Param() { 44 48 public Param(ParamBuilder builder) { 49 id = builder.getId(); 50 internalId = builder.getInternalId(); 51 name = builder.getName(); 52 help = builder.getHelp(); 53 group = builder.getGroup(); 54 flags = builder.getFlags(); 55 extra = 0; 45 56 } 46 57 58 @ParamAnnotation 47 59 public String getId() { 48 60 return id; … … 53 65 } 54 66 67 @ParamAnnotation 55 68 public String getName() { 56 69 return name; 57 70 } 58 71 72 @ParamAnnotation 59 73 public String getHelp() { 60 74 return help; 61 75 } 62 76 77 @ParamAnnotation 63 78 public Integer getGroup() { 64 79 return group; 65 80 } 66 81 82 @ParamAnnotation 67 83 public Integer getFlags() { 68 84 return flags; … … 79 95 public Integer getExtra() { 80 96 return extra; 81 }82 83 public void setInternalId(String internalId) {84 this.internalId = internalId;85 97 } 86 98 … … 104 116 } 105 117 106 public static FramsClass getFramsClass() {107 return new FramsClass("prop", "prop", null)108 .append(Param.build().id("name").name("Name").type(StringParam.class).finish())109 .append(Param.build().id("id").name("Id").type(StringParam.class).finish())110 .append(Param.build().id("type").name("Type").type(StringParam.class).finish())111 .append(Param.build().id("help").name("Help").type(StringParam.class).finish())112 .append(Param.build().id("flags").name("Flags").type(DecimalParam.class).finish());113 }114 115 118 public static ParamBuilder build() { 116 119 return new ParamBuilder(); 117 120 } 118 121 122 public static ParamBuilder build(FramsClassBuilder builder) { 123 return new ParamBuilder(builder); 124 } 125 119 126 }
Note: See TracChangeset
for help on using the changeset viewer.