- Timestamp:
- 06/28/13 11:56:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/core/ListChange.java
r85 r87 1 1 package com.framsticks.core; 2 2 3 import com.framsticks.params.FramsClass; 4 import com.framsticks.params.Param; 5 import com.framsticks.params.types.DecimalParam; 6 import com.framsticks.params.types.EnumParam; 7 import com.framsticks.params.types.StringParam; 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 8 5 import com.framsticks.util.lang.Strings; 9 10 import java.util.Arrays;11 6 12 7 /** 13 8 * @author Piotr Sniegowski 14 9 */ 10 @FramsClassAnnotation 15 11 public class ListChange { 16 12 … … 31 27 Remove, 32 28 Modify 29 // Add(0), 30 // Remove(1), 31 // Modify(2); 32 33 // public final int value; 34 35 // /** 36 // * @param value 37 // */ 38 // Action(int value) { 39 // this.value = value; 40 // } 41 33 42 } 34 43 35 private Action action; 36 private Integer position; 37 private String identifier; 44 public Action action = Action.Add; 45 @ParamAnnotation(id = "pos") 46 public Integer position; 47 @ParamAnnotation(id = "id") 48 public String identifier; 38 49 50 @ParamAnnotation 39 51 public Integer getType() { return action.ordinal(); } 52 @ParamAnnotation 40 53 public void setType(Integer type) { action = Action.values()[type]; } 41 42 public Integer getPos() { return position; }43 public void setPos(Integer pos) { position = pos; }44 45 public String getId() { return identifier; }46 public void setId(String id) { identifier = id; }47 54 48 55 public String getBestIdentifier() { … … 53 60 } 54 61 55 public static FramsClass getFramsClass() {56 return new FramsClass("ListChange", "ListChange", null)57 .append(Param.build().id("type").name("type").type(new EnumParam(Arrays.asList("Add", "Remove", "Modify"))))58 .append(Param.build().id("id").name("identifier").type(StringParam.class))59 .append(Param.build().id("pos").name("position").type(DecimalParam.class));60 }61 62 62 @Override 63 63 public String toString() {
Note: See TracChangeset
for help on using the changeset viewer.