Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
992 bytes
|
Line | |
---|
1 | package com.framsticks.params; |
---|
2 | |
---|
3 | import java.util.List; |
---|
4 | |
---|
5 | import javax.annotation.concurrent.Immutable; |
---|
6 | |
---|
7 | import com.framsticks.params.annotations.FramsClassAnnotation; |
---|
8 | import com.framsticks.params.annotations.ParamAnnotation; |
---|
9 | import com.framsticks.util.lang.Containers; |
---|
10 | |
---|
11 | /** |
---|
12 | * @author Piotr Sniegowski |
---|
13 | */ |
---|
14 | @FramsClassAnnotation |
---|
15 | @Immutable |
---|
16 | public class Group { |
---|
17 | |
---|
18 | @ParamAnnotation |
---|
19 | protected final String name; |
---|
20 | |
---|
21 | /** |
---|
22 | * Group members. |
---|
23 | */ |
---|
24 | protected final List<Param> params; |
---|
25 | |
---|
26 | public Group(GroupBuilder builder) { |
---|
27 | this.name = builder.getName(); |
---|
28 | this.params = builder.getParams(); |
---|
29 | } |
---|
30 | |
---|
31 | /** |
---|
32 | * Gets the property. |
---|
33 | * |
---|
34 | * @param i the i |
---|
35 | * @return the property |
---|
36 | */ |
---|
37 | public Param getParam(int number) { |
---|
38 | return Containers.getFromList(params, number, "param", this); |
---|
39 | } |
---|
40 | |
---|
41 | @Override |
---|
42 | public String toString() { |
---|
43 | return "group" + name; |
---|
44 | } |
---|
45 | |
---|
46 | /** |
---|
47 | * @return the name |
---|
48 | */ |
---|
49 | @ParamAnnotation |
---|
50 | public String getName() { |
---|
51 | return name; |
---|
52 | } |
---|
53 | |
---|
54 | public int getCount() { |
---|
55 | return params.size(); |
---|
56 | } |
---|
57 | |
---|
58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.