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 import java.util.concurrent.atomic.AtomicInteger; 17 18 /** 19 * This is a test bean that simulates storing external data that will be used for instantiating 20 * beans 21 * 22 * @since 2016-06-06 23 * @author kibertoad 24 * 25 */ 26 public class DataRegistry { 27 28 private final AtomicInteger counter = new AtomicInteger(1); 29 30 /** 31 * Generates pseudodata of format "<id>]-<id>" 32 * 33 * @param id 34 * @return 35 */ getDataForId(String id)36 public String getDataForId(String id) { 37 return id + "-" + id; 38 } 39 40 /** 41 * Returns next unassigned counter value 42 * 43 * @return 44 */ getNextCounterValue()45 public int getNextCounterValue() { 46 return counter.getAndIncrement(); 47 } 48 } 49