source: java/main/src/main/java/com/framsticks/params/types/DecimalParam.java @ 193

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: 773 bytes
Line 
1package com.framsticks.params.types;
2
3import com.framsticks.params.CastFailure;
4import com.framsticks.params.ParamBuilder;
5import com.framsticks.params.ReassignResult;
6
7import javax.annotation.concurrent.Immutable;
8
9/**
10 * @author Piotr Sniegowski
11 */
12@Immutable
13public class DecimalParam extends NumberParam<Integer> {
14
15        /**
16         * @param builder
17         */
18        public DecimalParam(ParamBuilder builder) {
19                super(builder.fillDef(0).fillStorageType(Integer.class));
20        }
21
22        @Override
23        public Class<?> getStorageType() {
24                return Integer.class;
25        }
26
27        @Override
28        public ReassignResult<Integer> reassign(Object newValue, Object oldValue) throws CastFailure {
29                return reassignNumber(newValue, oldValue, Integer.class);
30        }
31
32        @Override
33        public String getFramsTypeName() {
34                return "d";
35        }
36
37
38}
Note: See TracBrowser for help on using the repository browser.