/** * Returns a string indicating when the grid was generated. */ private static String getGeneratedString() { return "Generated: " + DateUtils.getMediumDateString(); }
/** * Tests whether the given double is equal to zero. * * @param value the value. * @return true or false. */ public static boolean isZero( double value ) { return isEqual( value, 0d ); }
/** * Start the clock. * @return the Clock. */ public Clock startClock() { this.start(); return this; }
public static <T> T invokeSetterMethod( String fieldName, Object target, Object... args ) { Method method = findSetterMethod( fieldName, target ); if ( method != null ) { return invokeMethod( target, method, args ); } return null; }
public static <T> T invokeGetterMethod( String fieldName, Object target ) { Method method = findGetterMethod( fieldName, target ); if ( method != null ) { return invokeMethod( target, method ); } return null; }
/** * Creates a document. * * @param outputStream The output stream to write the document content. * @return A Document. */ public static Document openDocument( OutputStream outputStream ) { return openDocument( outputStream, PageSize.A4 ); }
public static PdfPCell getItalicCell( String text ) { return getCell( text, 1, getItalicFont( 9 ), ALIGN_LEFT ); }
public static PdfPCell getTitleCell( String text, int colspan ) { return getCell( text, colspan, getBoldFont( 16 ), ALIGN_CENTER ); }
public static Font getBoldFont( float size ) { return getFont( "ubuntu-bold.ttf", size ); }
/** * Validates a whatsapp handle * @param whatsapp * @return */ public static boolean validateWhatsapp( String whatsapp ) { // Whatsapp uses international phonenumbers to identify users return validateInternationalPhoneNumber( whatsapp ); }
/** * Validates whether a date string is valid for the default Locale. * * @param date the date string. * @return true if the date string is valid, false otherwise. */ public static boolean dateIsValid( String date ) { return dateIsValid( date, null ); }
/** * Returns the number of days between the start date (inclusive) and end * date (inclusive). The value is rounded off to the floor value and does * not take daylight saving time into account. * * @param startDate the start-date. * @param endDate the end-date. * @return the number of days between the start and end-date. */ public static long getDaysInclusive( Date startDate, Date endDate ) { return getDays( startDate, endDate ) + 1; }
private static Field _findField( Class<?> clazz, String name ) { return _findField( clazz, name, null ); }
private static Method _findMethod( Class<?> clazz, String name ) { return _findMethod( clazz, name, new Class[0] ); }
protected static String formatDate( Date date ) { return DateUtils.getMediumDateString( date ); } }
@Override protected void startSerialize( RootNode rootNode, OutputStream outputStream ) throws Exception { document = PDFUtils.openDocument( outputStream ); }
public static PdfPCell getSubtitleCell( String text, int colspan ) { return getCell( text, colspan, getItalicFont( 12 ), ALIGN_CENTER ); }
public static Font getFont( float size ) { return getFont( "ubuntu.ttf", size ); }
public static Font getItalicFont( float size ) { return getFont( "ubuntu-italic.ttf", size ); }