1 /** 2 * Copyright (c) 2008, SnakeYAML 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the License 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 package examples.spring; 15 16 /** 17 * @since 2016-06-06 18 * @author kibertoad 19 * 20 */ 21 public class TestEntity { 22 23 // This field is supposed to be set by the means of calling {@link DataRegistry} and affects ID 24 // setting 25 private transient int counter; 26 27 // This field is supposed to be serialized and deserialized into YAML 28 private String id; 29 30 // This field is supposed to be set by the means of calling {@link DataRegistry} and is affected 31 // by ID 32 private transient String data; 33 34 getId()35 public String getId() { 36 return id; 37 } 38 getData()39 public String getData() { 40 return data; 41 } 42 setData(String data)43 public void setData(String data) { 44 this.data = data; 45 } 46 setId(String id)47 public void setId(String id) { 48 this.id = counter + ":" + id; 49 } 50 setCounter(int counter)51 public void setCounter(int counter) { 52 this.counter = counter; 53 } 54 getCounter()55 public int getCounter() { 56 return counter; 57 } 58 59 } 60