001/** 002 * Copyright (c) 2015-2022, Michael Yang 杨福海 (fuhai999@gmail.com). 003 * <p> 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * <p> 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * <p> 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package io.jboot.app.config; 017 018/** 019 * @author michael yang (fuhai999@gmail.com) 020 * @Date: 2020/3/24 021 */ 022public class ConfigPara { 023 024 private int start = 0; 025 private int end = 0; 026 private StringBuilder keyStringBuilder = null; 027 private StringBuilder defaultValueStringBuilder = null; 028 029 030 public String getKey() { 031 if (keyStringBuilder == null) { 032 return null; 033 } 034 return keyStringBuilder.toString(); 035 } 036 037 public String getDefaultValue() { 038 if (defaultValueStringBuilder == null) { 039 return ""; 040 } 041 return defaultValueStringBuilder.toString(); 042 } 043 044 045 void appendToKey(char c) { 046 if (keyStringBuilder == null) { 047 keyStringBuilder = new StringBuilder(); 048 } 049 keyStringBuilder.append(c); 050 } 051 052 void appendToDefaultValue(char c) { 053 if (defaultValueStringBuilder == null) { 054 defaultValueStringBuilder = new StringBuilder(); 055 } 056 defaultValueStringBuilder.append(c); 057 } 058 059 public int getStart() { 060 return start; 061 } 062 063 public void setStart(int start) { 064 this.start = start; 065 } 066 067 public int getEnd() { 068 return end; 069 } 070 071 public void setEnd(int end) { 072 this.end = end; 073 } 074 075}