1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.commons.vfs2; 18 19 import java.time.Duration; 20 import java.util.Objects; 21 import java.util.function.Function; 22 23 import org.apache.commons.lang3.StringUtils; 24 import org.apache.commons.lang3.time.DurationUtils; 25 26 /** 27 * Abstract class which has the right to fill FileSystemOptions. 28 */ 29 public abstract class FileSystemConfigBuilder { 30 31 /** Default prefix to use when resolving system properties */ 32 private static final String PREFIX = "vfs."; 33 34 /** The root URI of the file system */ 35 private static final String ROOTURI = "rootURI"; 36 37 /** The prefix to use when resolving system properties */ 38 private final String prefix; 39 40 /** 41 * Constructs builder with default prefix. 42 * 43 * @since 1.0 44 */ 45 protected FileSystemConfigBuilder() { 46 this.prefix = PREFIX; 47 } 48 49 /** 50 * Constructs builder with specified component name. 51 * 52 * @param component component name to be used in prefix 53 * 54 * @since 2.0 55 */ 56 protected FileSystemConfigBuilder(final String component) { 57 this.prefix = PREFIX + component; 58 } 59 60 /** 61 * Gets a named option as a Boolean. 62 * 63 * @param fileSystemOptions file system options to query, may be null. 64 * @param name the option name 65 * @return the option in {@code opts} or system properties, otherwise null 66 * @see #getBoolean(FileSystemOptions, String, Boolean) 67 * 68 * @since 2.0 69 */ 70 protected Boolean getBoolean(final FileSystemOptions fileSystemOptions, final String name) { 71 return getBoolean(fileSystemOptions, name, null); 72 } 73 74 /** 75 * Gets a named option as a Boolean. 76 * 77 * @param fileSystemOptions file system options to query, may be null. 78 * @param name the option name 79 * @param defaultValue value to return if option is not present 80 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 81 * @see #getBoolean(FileSystemOptions, String, Boolean) 82 * 83 * @since 2.0 84 */ 85 protected boolean getBoolean(final FileSystemOptions fileSystemOptions, final String name, 86 final boolean defaultValue) { 87 return getBoolean(fileSystemOptions, name, Boolean.valueOf(defaultValue)).booleanValue(); 88 } 89 90 /** 91 * Gets a named option as a Boolean. 92 * 93 * @param fileSystemOptions file system options to query, may be null. 94 * @param name the option name 95 * @param defaultValue value to return if option is not present 96 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 97 * @see #getBoolean(FileSystemOptions, String, Boolean) 98 * 99 * @since 2.0 100 */ 101 protected Boolean getBoolean(final FileSystemOptions fileSystemOptions, final String name, 102 final Boolean defaultValue) { 103 return getParam(fileSystemOptions, name, defaultValue, Boolean::valueOf); 104 } 105 106 /** 107 * Gets a named option as a Byte. 108 * 109 * @param fileSystemOptions file system options to query, may be null. 110 * @param name the option name 111 * @return the option in {@code opts} or system properties, otherwise null 112 * @see #getByte(FileSystemOptions, String, Byte) 113 * 114 * @since 2.0 115 */ 116 protected Byte getByte(final FileSystemOptions fileSystemOptions, final String name) { 117 return getByte(fileSystemOptions, name, null); 118 } 119 120 /** 121 * Gets a named option as a Byte. 122 * 123 * @param fileSystemOptions file system options to query, may be null. 124 * @param name the option name 125 * @param defaultValue value to return if option is not present 126 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 127 * @see #getByte(FileSystemOptions, String, Byte) 128 * 129 * @since 2.0 130 */ 131 protected byte getByte(final FileSystemOptions fileSystemOptions, final String name, final byte defaultValue) { 132 return getByte(fileSystemOptions, name, Byte.valueOf(defaultValue)).byteValue(); 133 } 134 135 /** 136 * Gets a named option as a Byte. 137 * 138 * @param fileSystemOptions file system options to query, may be null. 139 * @param name the option name 140 * @param defaultValue value to return if option is not present 141 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 142 * 143 * @since 2.0 144 */ 145 protected Byte getByte(final FileSystemOptions fileSystemOptions, final String name, final Byte defaultValue) { 146 return getParam(fileSystemOptions, name, defaultValue, Byte::valueOf); 147 } 148 149 /** 150 * Gets a named option as a Character. 151 * 152 * @param fileSystemOptions file system options to query, may be null. 153 * @param name the option name 154 * @return the option in {@code opts} or system properties, otherwise null 155 * @see #getCharacter(FileSystemOptions, String, Character) 156 * 157 * @since 2.0 158 */ 159 protected Character getCharacter(final FileSystemOptions fileSystemOptions, final String name) { 160 return getCharacter(fileSystemOptions, name, null); 161 } 162 163 /** 164 * Gets a named option as a Character. 165 * 166 * @param fileSystemOptions file system options to query, may be null. 167 * @param name the option name 168 * @param defaultValue value to return if option is not present 169 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 170 * @see #getCharacter(FileSystemOptions, String, Character) 171 * 172 * @since 2.0 173 */ 174 protected char getCharacter(final FileSystemOptions fileSystemOptions, final String name, final char defaultValue) { 175 return getCharacter(fileSystemOptions, name, Character.valueOf(defaultValue)).charValue(); 176 } 177 178 /** 179 * Gets a named option as a Character. 180 * 181 * @param fileSystemOptions file system options to query, may be null. 182 * @param name the option name 183 * @param defaultValue value to return if option is not present 184 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 185 * 186 * @since 2.0 187 */ 188 protected Character getCharacter(final FileSystemOptions fileSystemOptions, final String name, 189 final Character defaultValue) { 190 Character value = getParam(fileSystemOptions, name); 191 if (value == null) { 192 final String str = getProperty(name); 193 if (StringUtils.isEmpty(str)) { 194 return defaultValue; 195 } 196 value = Character.valueOf(str.charAt(0)); 197 } 198 return value; 199 } 200 201 /** 202 * Gets the target of this configuration. 203 * 204 * @return the specific file system class 205 * 206 * @since 1.0 207 */ 208 protected abstract Class<? extends FileSystem> getConfigClass(); 209 210 /** 211 * Gets a named option as a Double. 212 * 213 * @param fileSystemOptions file system options to query, may be null. 214 * @param name the option name 215 * @return the option in {@code opts} or system properties, otherwise null 216 * @see #getDouble(FileSystemOptions, String, Double) 217 * 218 * @since 2.0 219 */ 220 protected Double getDouble(final FileSystemOptions fileSystemOptions, final String name) { 221 return getDouble(fileSystemOptions, name, null); 222 } 223 224 /** 225 * Gets a named option as a Double. 226 * 227 * @param fileSystemOptions file system options to query, may be null. 228 * @param name the option name 229 * @param defaultValue value to return if option is not present 230 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 231 * @see #getDouble(FileSystemOptions, String, Double) 232 * 233 * @since 2.0 234 */ 235 protected double getDouble(final FileSystemOptions fileSystemOptions, final String name, 236 final double defaultValue) { 237 return getDouble(fileSystemOptions, name, new Double(defaultValue)).doubleValue(); 238 } 239 240 /** 241 * Gets a named option as a Double. 242 * 243 * @param fileSystemOptions file system options to query, may be null. 244 * @param name the option name 245 * @param defaultValue value to return if option is not present 246 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 247 * 248 * @since 2.0 249 */ 250 protected Double getDouble(final FileSystemOptions fileSystemOptions, final String name, 251 final Double defaultValue) { 252 return getParam(fileSystemOptions, name, defaultValue, Double::valueOf); 253 } 254 255 /** 256 * Gets a named option as a Duration. 257 * 258 * @param fileSystemOptions file system options to query, may be null. 259 * @param name the option name 260 * @return the option in {@code opts} or system properties, otherwise null 261 * @see #getLong(FileSystemOptions, String, Long) 262 * 263 * @since 2.8.0 264 */ 265 protected Duration getDuration(final FileSystemOptions fileSystemOptions, final String name) { 266 return getDuration(fileSystemOptions, name, null); 267 } 268 269 /** 270 * Gets a named option as a Duration. 271 * 272 * @param fileSystemOptions file system options to query, may be null. 273 * @param name the option name 274 * @param defaultValue value to return if option is not present 275 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 276 * 277 * @since 2.8.0 278 */ 279 protected Duration getDuration(final FileSystemOptions fileSystemOptions, final String name, 280 final Duration defaultValue) { 281 return getParam(fileSystemOptions, name, defaultValue, Duration::parse); 282 } 283 284 /** 285 * Gets a named option as a Duration bound to the integer range. 286 * 287 * @param fileSystemOptions file system options to query, may be null. 288 * @param name the option name 289 * @return the option in {@code opts} or system properties, otherwise null 290 * @see #getLong(FileSystemOptions, String, Long) 291 * 292 * @since 2.8.0 293 */ 294 protected Integer getDurationInteger(final FileSystemOptions fileSystemOptions, final String name) { 295 return getDurationInteger(fileSystemOptions, name, null); 296 } 297 298 /** 299 * Gets a named option as a Duration bound to the integer range. 300 * 301 * @param fileSystemOptions file system options to query, may be null. 302 * @param name the option name 303 * @param defaultValue value to return if option is not present 304 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 305 * 306 * @since 2.8.0 307 */ 308 protected Integer getDurationInteger(final FileSystemOptions fileSystemOptions, final String name, 309 final Duration defaultValue) { 310 return DurationUtils.toMillisInt(getParam(fileSystemOptions, name, defaultValue, Duration::parse)); 311 } 312 313 /** 314 *Gets a named option as a Double. 315 * 316 * @param <E> enumeration type 317 * @param enumClass class of enumeration type 318 * @param fileSystemOptions file system options to query, may be null. 319 * @param name the option name * 320 * @return the option in {@code opts} or system properties, otherwise null 321 * @see #getEnum(Class, FileSystemOptions, String, Enum) 322 * @throws IllegalArgumentException if option value is not a known enumeration. 323 * 324 * @since 2.1 325 */ 326 protected <E extends Enum<E>> E getEnum(final Class<E> enumClass, final FileSystemOptions fileSystemOptions, 327 final String name) { 328 return this.<E>getEnum(enumClass, fileSystemOptions, name, null); 329 } 330 331 /** 332 * Gets a named option as an Enum. 333 * 334 * @param <E> enumeration type 335 * @param enumClass class of enumeration type 336 * @param fileSystemOptions file system options to query, may be null. 337 * @param name the option name 338 * @param defaultValue value to return if option is not present 339 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 340 * @see #getEnum(Class, FileSystemOptions, String, Enum) 341 * @throws IllegalArgumentException if option value is not a known enumeration. 342 * 343 * @since 2.1 344 */ 345 protected <E extends Enum<E>> E getEnum(final Class<E> enumClass, final FileSystemOptions fileSystemOptions, 346 final String name, final E defaultValue) { 347 E value = getParam(fileSystemOptions, name); 348 if (value == null) { 349 final String str = getProperty(name); 350 if (str == null) { 351 return defaultValue; 352 } 353 value = Enum.valueOf(enumClass, str); 354 } 355 return value; 356 } 357 358 /** 359 * Gets a named option as a Float. 360 * 361 * @param fileSystemOptions file system options to query, may be null. 362 * @param name the option name 363 * @return the option in {@code opts} or system properties, otherwise null 364 * @see #getFloat(FileSystemOptions, String, Float) 365 * @throws NumberFormatException if option value is not a valid float. 366 * 367 * @since 2.0 368 */ 369 protected Float getFloat(final FileSystemOptions fileSystemOptions, final String name) { 370 return getFloat(fileSystemOptions, name, null); 371 } 372 373 /** 374 * Gets a named option as a Float. 375 * 376 * @param fileSystemOptions file system options to query, may be null. 377 * @param name the option name 378 * @param defaultValue value to return if option is not present 379 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 380 * @see #getFloat(FileSystemOptions, String, Float) 381 * @throws NumberFormatException if option value is not a valid float. 382 * 383 * @since 2.0 384 */ 385 protected float getFloat(final FileSystemOptions fileSystemOptions, final String name, final float defaultValue) { 386 return getFloat(fileSystemOptions, name, new Float(defaultValue)).floatValue(); 387 } 388 389 /** 390 * Gets a named option as a Float. 391 * 392 * @param fileSystemOptions file system options to query, may be null. 393 * @param name the option name 394 * @param defaultValue value to return if option is not present 395 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 396 * @throws NumberFormatException if option value is not a valid float. 397 * 398 * @since 2.0 399 */ 400 protected Float getFloat(final FileSystemOptions fileSystemOptions, final String name, final Float defaultValue) { 401 return getParam(fileSystemOptions, name, defaultValue, Float::valueOf); 402 } 403 404 /** 405 * Gets a named option as an Integer. 406 * 407 * @param fileSystemOptions file system options to query, may be null. 408 * @param name the option name 409 * @return the option in {@code opts} or system properties, otherwise null 410 * @see #getInteger(FileSystemOptions, String, Integer) 411 * @throws NumberFormatException if option value is not a valid integer. 412 * 413 * @since 2.0 414 */ 415 protected Integer getInteger(final FileSystemOptions fileSystemOptions, final String name) { 416 return getInteger(fileSystemOptions, name, null); 417 } 418 419 /** 420 * Gets a named option as an Integer. 421 * 422 * @param fileSystemOptions file system options to query, may be null. 423 * @param name the option name 424 * @param defaultValue value to return if option is not present 425 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 426 * @see #getInteger(FileSystemOptions, String, Integer) 427 * @throws NumberFormatException if option value is not a valid integer. 428 * 429 * @since 2.0 430 */ 431 protected int getInteger(final FileSystemOptions fileSystemOptions, final String name, final int defaultValue) { 432 return getInteger(fileSystemOptions, name, Integer.valueOf(defaultValue)).intValue(); 433 } 434 435 /** 436 * Gets a named option as an Integer. 437 * 438 * @param fileSystemOptions file system options to query, may be null. 439 * @param name the option name 440 * @param defaultValue value to return if option is not present 441 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 442 * @throws NumberFormatException if option value is not a valid integer. 443 * 444 * @since 2.0 445 */ 446 protected Integer getInteger(final FileSystemOptions fileSystemOptions, final String name, 447 final Integer defaultValue) { 448 return getParam(fileSystemOptions, name, defaultValue, Integer::valueOf); 449 } 450 451 /** 452 * Gets a named option as a Long. 453 * 454 * @param fileSystemOptions file system options to query, may be null. 455 * @param name the option name 456 * @return the option in {@code opts} or system properties, otherwise null 457 * @see #getLong(FileSystemOptions, String, Long) 458 * @throws NumberFormatException if option value is not a valid long. 459 * 460 * @since 2.0 461 */ 462 protected Long getLong(final FileSystemOptions fileSystemOptions, final String name) { 463 return getLong(fileSystemOptions, name, null); 464 } 465 466 /** 467 * Gets a named option as a Long. 468 * 469 * @param fileSystemOptions file system options to query, may be null. 470 * @param name the option name 471 * @param defaultValue value to return if option is not present 472 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 473 * @see #getLong(FileSystemOptions, String, Long) 474 * @throws NumberFormatException if option value is not a valid long. 475 * 476 * @since 2.0 477 */ 478 protected long getLong(final FileSystemOptions fileSystemOptions, final String name, final long defaultValue) { 479 return getLong(fileSystemOptions, name, Long.valueOf(defaultValue)).longValue(); 480 } 481 482 /** 483 * Gets a named option as a Long. 484 * 485 * @param fileSystemOptions file system options to query, may be null. 486 * @param name the option name 487 * @param defaultValue value to return if option is not present 488 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 489 * @throws NumberFormatException if option value is not a valid long. 490 * 491 * @since 2.0 492 */ 493 protected Long getLong(final FileSystemOptions fileSystemOptions, final String name, final Long defaultValue) { 494 return getParam(fileSystemOptions, name, defaultValue, Long::valueOf); 495 } 496 497 /** 498 * Gets a named parameter. 499 * 500 * @param <T> The expected return type. 501 * @param fileSystemOptions file system options to query, may be null. 502 * @param name get option with this name 503 * @return the named option or null 504 * 505 * @since 1.0 506 */ 507 protected <T> T getParam(final FileSystemOptions fileSystemOptions, final String name) { 508 return fileSystemOptions == null ? null : fileSystemOptions.getOption(getConfigClass(), name); 509 } 510 511 /** 512 * Gets a named parameter. 513 * 514 * @param <T> The expected return type. 515 * @param fileSystemOptions file system options to query, may be null. 516 * @param name get option with this name 517 * @param defaultValue value to use if the system property value is null. 518 * @param function Builds an instance of T from a system property String value. 519 * @return the named option or null 520 * 521 * @since 2.8.0 522 */ 523 private <T> T getParam(final FileSystemOptions fileSystemOptions, final String name, final T defaultValue, 524 final Function<String, T> function) { 525 T value = getParam(fileSystemOptions, name); 526 if (value == null) { 527 final String str = getProperty(name); 528 if (str == null) { 529 return defaultValue; 530 } 531 if (function != null) { 532 value = function.apply(str); 533 } 534 } 535 return value; 536 } 537 538 /** 539 * Gets the system property for the given name. 540 * 541 * @param name The name to lookup combined with the prefix. 542 * @return a system property or null 543 * 544 * @since 2.1 545 */ 546 private String getProperty(final String name) { 547 return System.getProperty(toPropertyKey(name)); 548 } 549 550 /** 551 * Gets the root URI of the file system. 552 * 553 * @param fileSystemOptions file system options to query, may be null. 554 * @return The root URI, or null. 555 * 556 * @since 2.0 557 */ 558 public String getRootURI(final FileSystemOptions fileSystemOptions) { 559 return getString(fileSystemOptions, ROOTURI); 560 } 561 562 /** 563 * Gets a named option as a Short. 564 * 565 * @param fileSystemOptions file system options to query, may be null. 566 * @param name the option name 567 * @return the option in {@code opts} or system properties, otherwise null 568 * @see #getShort(FileSystemOptions, String, Short) 569 * @throws NumberFormatException if option value is not a valid short. 570 * 571 * @since 2.0 572 */ 573 protected Short getShort(final FileSystemOptions fileSystemOptions, final String name) { 574 return getShort(fileSystemOptions, name, null); 575 } 576 577 /** 578 * Gets a named option as a Short. 579 * 580 * @param fileSystemOptions file system options to query, may be null. 581 * @param name the option name 582 * @param defaultValue value to return if option is not present 583 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 584 * @see #getShort(FileSystemOptions, String, Short) 585 * @throws NumberFormatException if option value is not a valid short 586 * 587 * @since 2.0 588 */ 589 protected short getShort(final FileSystemOptions fileSystemOptions, final String name, final short defaultValue) { 590 return getShort(fileSystemOptions, name, Short.valueOf(defaultValue)).shortValue(); 591 } 592 593 /** 594 * Gets a named option as a Short. 595 * 596 * @param fileSystemOptions file system options to query, may be null. 597 * @param name the option name 598 * @param defaultValue value to return if option is not present 599 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 600 * @throws NumberFormatException if option value is not a valid short 601 * 602 * @since 2.0 603 */ 604 protected Short getShort(final FileSystemOptions fileSystemOptions, final String name, final Short defaultValue) { 605 return getParam(fileSystemOptions, name, defaultValue, Short::valueOf); 606 } 607 608 /** 609 * Gets a named option as a String. 610 * 611 * @param fileSystemOptions file system options to query, may be null. 612 * @param name the option name 613 * @return the option in {@code opts} or system properties, otherwise null 614 * @see #getString(FileSystemOptions, String, String) 615 * 616 * @since 2.0 617 */ 618 protected String getString(final FileSystemOptions fileSystemOptions, final String name) { 619 return getString(fileSystemOptions, name, null); 620 } 621 622 /** 623 * Gets a named option as a String. 624 * 625 * @param fileSystemOptions file system options to query, may be null. 626 * @param name the option name 627 * @param defaultValue value to return if option is not present 628 * @return the option in {@code opts} or system properties, otherwise {@code defaultValue} 629 * 630 * @since 2.0 631 */ 632 protected String getString(final FileSystemOptions fileSystemOptions, final String name, 633 final String defaultValue) { 634 return getParam(fileSystemOptions, name, defaultValue, String::valueOf); 635 } 636 637 /** 638 * Checks the named setting specified. 639 * 640 * @param fileSystemOptions file system options to query, may be null. 641 * @param name the option to check in {@code opts} or system properties 642 * @return true if option exists 643 * 644 * @since 2.0 645 */ 646 protected boolean hasObject(final FileSystemOptions fileSystemOptions, final String name) { 647 return hasParam(fileSystemOptions, name) || System.getProperties().containsKey(toPropertyKey(name)); 648 } 649 650 /** 651 * Checks if option exists. 652 * 653 * @param fileSystemOptions file system options to query, may be null. 654 * @param name the name to look up in {@code opts} 655 * @return true if opts have the named parameter 656 * 657 * @since 1.0 658 */ 659 protected boolean hasParam(final FileSystemOptions fileSystemOptions, final String name) { 660 return fileSystemOptions != null && fileSystemOptions.hasOption(getConfigClass(), name); 661 } 662 663 /** 664 * Sets the named parameter. 665 * 666 * @param fileSystemOptions the file system options to modify 667 * @param name set option with this name 668 * @param value boolean value to set 669 * 670 * @since 2.1 671 */ 672 protected void setParam(final FileSystemOptions fileSystemOptions, final String name, final boolean value) { 673 setParam(fileSystemOptions, name, Boolean.valueOf(value)); 674 } 675 676 /** 677 * Sets the named parameter. 678 * 679 * @param fileSystemOptions the file system options to modify 680 * @param name set option with this name 681 * @param value object value to set 682 * 683 * @since 1.0 684 */ 685 protected void setParam(final FileSystemOptions fileSystemOptions, final String name, final Object value) { 686 Objects.requireNonNull(fileSystemOptions, "fileSystemOptions").setOption(getConfigClass(), name, value); 687 } 688 689 /** 690 * Sets the root URI of the file system. 691 * 692 * @param fileSystemOptions the file system options to modify 693 * @param rootURI The creator name to be associated with the file. 694 * 695 * @since 2.0 696 */ 697 public void setRootURI(final FileSystemOptions fileSystemOptions, final String rootURI) { 698 setParam(fileSystemOptions, ROOTURI, rootURI); 699 } 700 701 /** 702 * Converts the given primitive boolean to a Boolean object. 703 * 704 * @param value a primitive boolean. 705 * @return the given primitive boolean as Boolean object. 706 * @since 2.7.0 707 */ 708 protected Boolean toBooleanObject(final boolean value) { 709 return value ? Boolean.TRUE : Boolean.FALSE; 710 } 711 712 /** 713 * Converts the given name into a System property key. 714 * 715 * @param name a name to combine with the builder prefix 716 * @return name of system property 717 * 718 * @since 2.1 719 */ 720 private String toPropertyKey(final String name) { 721 return this.prefix + name; 722 } 723 724 }