1   /*
2    * Copyright 2004 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.ancientprogramming.fixedformat4j.format.impl;
17  
18  import com.ancientprogramming.fixedformat4j.annotation.Align;
19  import com.ancientprogramming.fixedformat4j.annotation.Field;
20  import com.ancientprogramming.fixedformat4j.annotation.Fields;
21  import com.ancientprogramming.fixedformat4j.annotation.FixedFormatPattern;
22  import com.ancientprogramming.fixedformat4j.annotation.Record;
23  
24  import java.util.Date;
25  
26  /**
27   * @author Jacob von Eyben - http://www.ancientprogramming.com
28   * @since 1.0.0
29   */
30  @Record
31  public class MultibleFieldsRecord {
32  
33    private String stringData;
34    private Date dateData;
35    private Integer integerdata;
36  
37    @Field(offset = 1, length = 10, align = Align.RIGHT, paddingChar = ' ')
38    public String getStringData() {
39      return stringData;
40    }
41  
42    public void setStringData(String stringData) {
43      this.stringData = stringData;
44    }
45  
46    @Fields({@Field(offset = 11, length = 8), @Field(offset = 19, length = 8)})
47    public Date getDateData() {
48      return dateData;
49    }
50  
51    public void setDateData(Date dateData) {
52      this.dateData = dateData;
53    }
54  
55    @Field(offset = 50, length = 4, align = Align.RIGHT, paddingChar = '0')
56    public Integer getIntegerdata() {
57      return integerdata;
58    }
59  
60    public void setIntegerdata(Integer integerdata) {
61      this.integerdata = integerdata;
62    }
63  }