Java Number Min Value minLengthExpression(final String operand, final long minLength)

Here you can find the source of minLengthExpression(final String operand, final long minLength)

Description

Build expression to check the 'minLength' restriction, depending on the data type of the member variable.

License

Open Source License

Parameter

Parameter Description
operand Name of member variable or other operand (e.g. a string literal) for comparison in expression
minLength Value of 'minLength' restriction

Return

Expression for restriction check

Declaration

public static String minLengthExpression(final String operand, final long minLength) 

Method Source Code

//package com.java2s;

public class Main {
    /**// w  ww .  ja  v a2s  .  c  o  m
     * Build expression to check the 'minLength' restriction, depending
     * on the data type of the member variable.
     *
     * @param operand Name of member variable or other operand (e.g.
     * a string literal) for comparison in expression
     * @param minLength Value of 'minLength' restriction
     *
     * @return Expression for restriction check
     */
    public static String minLengthExpression(final String operand, final long minLength) {
        return String.format("%s.length() < %d", operand, minLength);
    }
}

Related

  1. minInt(int a, int b)
  2. minInteger(int var1, int var2)
  3. minInteger(Integer a, Integer b)
  4. minLength(String field, Integer from)
  5. minLength(String value, int min)
  6. minLimit(double d, double limit)
  7. minLimit(float value, float min)
  8. minLog2(int input)
  9. minMax(double v, double min, double max)