/** * Returns the delimiter to be used by colliding command line args when * creating non colliding arg's aliases (keys for key/value-pairs). * * @return The according delimiter. */ protected char getDelimiter() { return Delimiter.INDEX.getChar(); }
/** * Create an empty {@link PathMapBuilder} instance using the default path * delimiter "/" ({@link Delimiter#PATH}) for the path declarations. * * @param aType The type of the values being referenced by the paths. */ public PathMapBuilderImpl( Class<T> aType ) { this( Delimiter.PATH.getChar(), aType ); }
/** * Create a {@link PathMapBuilder} instance containing the elements as of * {@link MutablePathMap#insert(Object)} using the default path delimiter * "/" ({@link Delimiter#PATH}) for the path declarations. * * @param aObj The object from which the elements are to be added. * * @param aType The type of the values being referenced by the paths. */ public PathMapBuilderImpl( Object aObj, Class<T> aType ) { this( aObj, Delimiter.PATH.getChar(), aType ); }
/** * Returns the default path delimiter as of {@link Delimiter#PATH}. * * {@inheritDoc} */ @Override default char getDelimiter() { return Delimiter.PATH.getChar(); }
/** * Initializes the {@link PropertyImpl} with the given values. * * @param aTupel A tupel is a key and a value with the assignment operator * "=" inbetween, e.g. "a=5" (the key would be a, the value would be * 5). */ public PropertyImpl( String aTupel ) { this( aTupel, Delimiter.PROPERTY.getChar() ); }
/** * Creates a {@link PathMapBuilder} instance containing the elements as of * {@link MutablePathMap#insert(Object)} using the default path delimiter * "/" ({@link Delimiter#PATH}) for the path declarations. * * @param aObj The object from which the elements are to be added. * * @param aFromPath The path from where to start adding elements of the * provided object. * * @param aType The type of the values being referenced by the paths. */ public PathMapBuilderImpl( Object aObj, String aFromPath, Class<T> aType ) { this( aObj, aFromPath, Delimiter.PATH.getChar(), aType ); }
/** * Create a {@link PathMapBuilder} instance containing the elements as of * {@link MutablePathMap#insert(Object)} using the default path delimiter * "/" ({@link Delimiter#PATH}) for the path declarations. * * @param aToPath The sub-path where to insert the object's introspected * values to. * * @param aObj The object from which the elements are to be added. * * @param aType The type of the values being referenced by the paths. */ public PathMapBuilderImpl( String aToPath, Object aObj, Class<T> aType ) { this( aToPath, aObj, Delimiter.PATH.getChar(), aType ); }
/** * {@inheritDoc} */ @Override public void setBaseLocator( String aBaseLocator ) { if ( !aBaseLocator.startsWith( Delimiter.PATH.getChar() + "" ) ) { throw new IllegalArgumentException( "Your provided base locator <" + aBaseLocator + "> is not an absolute locator, it has to start with a slash (\"" + Delimiter.PATH.getChar() + "\") character to be an absolute locator." ); } _baseLocator = aBaseLocator; }
/** * Retrieves the fully qualified method name from a * {@link StackTraceElement}. This adds the method name to the fully * qualified path name separated by a hash "#". * * @param aStackTraceElement The {@link StackTraceElement} from which to * retrieve the fully qualified method name. * * @return The fully qualified method name or null in case the stack trace * element was null. */ public static String toFullyQualifiedMethodName( StackTraceElement aStackTraceElement ) { if ( aStackTraceElement == null ) return null; return aStackTraceElement.getClassName() + Delimiter.METHOD_NAME.getChar() + aStackTraceElement.getMethodName(); }
/** * Removes any leading path delimiters (as of {@link Delimiter#PATH}). * * @param aPath The path to be processed. * * @return The path without any leading path delimiters. */ static String toTruncatePathPrefix( String aPath ) { if ( aPath != null ) { while ( aPath.length() > 0 && aPath.charAt( 0 ) == Delimiter.PATH.getChar() ) { aPath = aPath.substring( 1 ); } } return aPath; }
/** * Removes any trailing path delimiters (as of {@link Delimiter#PATH}). * * @param aPath The path to be processed. * * @return The path without any trailing path delimiters. */ static String toTruncatePathSuffix( String aPath ) { if ( aPath != null ) { while ( aPath.length() > 0 && aPath.charAt( aPath.length() - 1 ) == Delimiter.PATH.getChar() ) { aPath = aPath.substring( 0, aPath.length() - 1 ); } } return aPath; }
/** * Same as {@link #asIntegerArray(String, char)} using a comma (',') as * delimiter. * * @param aKey The key, which's value is to be converted to an array. * * @return The according array or null if no (or a null) value has been * associated to the key. */ default int[] asIntegerArray( String aKey ) throws NumberFormatException { return asIntegerArray( aKey, Delimiter.LIST.getChar() ); }
/** * Same as {@link #asLongArray(String, char)} using a comma (',') as * delimiter. * * @param aKey The key, which's value is to be converted to an array. * * @return The according array or null if no (or a null) value has been * associated to the key. */ default long[] asLongArray( Enum<?> aKey ) throws NumberFormatException { return asLongArray( aKey.toString(), Delimiter.LIST.getChar() ); }
/** * {@inheritDoc} */ @Override public String toEnvironmentVariable( String aKey ) { if ( aKey == null || aKey.length() == 0 ) return aKey; String theKey = toNormalized( aKey, Delimiter.SNAKE_CASE.getChar() ); return theKey != null ? theKey.toUpperCase() : theKey; }
/** * Retrieves the fully qualified method name of the caller of this method. * This adds the method name to the caller's fully qualified path name * separated by a hash "#". * * @return The fully qualified method name. */ public static String toFullyQualifiedMethodName() { StackTraceElement theStackTraceElement = getCallerStackTraceElement(); return theStackTraceElement.getClassName() + Delimiter.METHOD_NAME.getChar() + theStackTraceElement.getMethodName(); }
/** * Same as {@link #asBooleanArray(String, char)} using a comma (',') as * delimiter. * * @param aKey The key, which's value is to be converted to an array. * * @return The according array or null if no (or a null) value has been * associated to the key. */ default boolean[] asBooleanArray( Enum<?> aKey ) throws NumberFormatException { return asBooleanArray( aKey.toString(), Delimiter.LIST.getChar() ); }
/** * Same as {@link #asBooleanArray(String, char)} using a comma (',') as * delimiter. * * @param aKey The key, which's value is to be converted to an array. * * @return The according array or null if no (or a null) value has been * associated to the key. */ default boolean[] asBooleanArray( String aKey ) throws NumberFormatException { return asBooleanArray( aKey, Delimiter.LIST.getChar() ); }
/** * Same as {@link #asByteArray(String, char)} using a comma (',') as * delimiter. * * @param aKey The key, which's value is to be converted to an array. * * @return The according array or null if no (or a null) value has been * associated to the key. */ default byte[] asByteArray( Enum<?> aKey ) throws NumberFormatException { return asByteArray( aKey.toString(), Delimiter.LIST.getChar() ); }