Here you can find the source of minLengthExpression(final String operand, final long minLength)
Parameter | Description |
---|---|
operand | Name of member variable or other operand (e.g. a string literal) for comparison in expression |
minLength | Value of 'minLength' restriction |
public static String minLengthExpression(final String operand, final long minLength)
//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); } }