Compact Class For Java – CCLogic


Compact Class is a collection of common functions and classes that can make your code more concise, fast, and precise.

utility

Class CCLogic

java.lang.Object

extended by

utility.CCLogic

public class CCLogicextends java.lang.Object

CCLogic is a collection of method is used to check the simple logic that is
often used.

Since:
10.03.17
Version:
12.03.17
Author:
Yosua Onesimus


Constructor Detail

CCLogic

public CCLogic()


Method Detail

isNull

public static boolean isNull(java.lang.Object object)
Check whether an object equal to null.

 

Parameters:
object

 

Returns:true if, and only if, object is null.


isNotNull

public static boolean isNotNull(java.lang.Object object)
Check whether an object not equal to null.

 

Parameters:
object

 

Returns:true if, and only if, object is NOT null.


isThere

public static boolean isThere(java.lang.String className)
Check if there is a class with the specified name.

 

Parameters:
className

 

Returns:boolean


isEmpty

public static boolean isEmpty(java.lang.String string)
Check whether a string is empty.

 

Parameters:
string

 

Returns:true if, and only if, string is empty.


isNotEmpty

public static boolean isNotEmpty(java.lang.String string)
Check whether a string is not empty.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT empty.


isEmpty

public static boolean isEmpty(java.util.Collection collection)
Check whether a collection is empty.

 

Parameters:
collection

 

Returns:true if, and only if, collection is empty.


isNotEmpty

public static boolean isNotEmpty(java.util.Collection collection)
Check whether a collection is not empty.

 

Parameters:
collection

 

Returns:true if, and only if, collection is NOT empty.


isEmpty

public static boolean isEmpty(java.util.Map map)
Check whether a map is empty.

 

Parameters:
map

 

Returns:true if, and only if, map is empty.


isNotEmpty

public static boolean isNotEmpty(java.util.Map map)
Check whether a map is not empty.

 

Parameters:
map

 

Returns:true if, and only if, map is NOT empty.


isNullOrEmpty

public static boolean isNullOrEmpty(java.lang.Object object)
Check whether an object equal to null or an object is empty.

 

Parameters:
object

 

Returns:true if, and only if, object is null or object is empty.


isNotNullAndNotEmpty

public static boolean isNotNullAndNotEmpty(java.lang.Object object)
Check whether an object not equal to null and an object is not empty.

 

Parameters:
object

 

Returns:true if, and only if, object is NOT null or object is NOT empty.


isDigit

public static boolean isDigit(java.lang.String string)
Check whether a string is digit only.

 

Parameters:
string

 

Returns:true if, and only if, string is digit.


isNotDigit

public static boolean isNotDigit(java.lang.String string)
Check whether a string is not digit only.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT digit.


isNumeric

public static boolean isNumeric(java.lang.String string)
Check whether a string is numeric only.

 

Parameters:
string

 

Returns:true if, and only if, string is numeric.


isNotNumeric

public static boolean isNotNumeric(java.lang.String string)
Check whether a string is not numeric only.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT numeric.


isDecimal

public static boolean isDecimal(java.lang.String string)
Check whether a string is decimal only.

 

Parameters:
string

 

Returns:true if, and only if, string is decimal.


isNotDecimal

public static boolean isNotDecimal(java.lang.String string)
Check whether a string is not decimal only.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT decimal.


isInfinite

public static boolean isInfinite(java.lang.Number number)
Check whether a number is infinite.

 

Parameters:
number

 

Returns:true if, and only if, number is infinite.


isNaN

public static boolean isNaN(java.lang.Number number)
Check whether a number is NaN.

 

Parameters:
number

 

Returns:true if, and only if, number is NaN.


isInfiniteOrNaN

public static boolean isInfiniteOrNaN(java.lang.Number number)
Check whether a number is infinite or a number is NaN.

 

Parameters:
number

 

Returns:boolean


isInfiniteOrNaN

public static boolean isInfiniteOrNaN(java.lang.String string)
Check whether a string is infinite or a string is NaN.

 

Parameters:
string

 

Returns:true if, and only if, string is infinite or string is NaN.


coalesce

public static java.lang.Object coalesce(java.lang.Object theValue,
                                        java.lang.Object defaultValue)
Parameters:
theValue
defaultValue

Returns:object


isEmail

public static boolean isEmail(java.lang.String string)
Check whether a string is email.

 

Parameters:
string

 

Returns:true if, and only if, string is email.


isNotEmail

public static boolean isNotEmail(java.lang.String string)
Check whether a string is not email.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT email.


isPhoneNumber

public static boolean isPhoneNumber(java.lang.String string)
Check whether a string is phone number.

 

Parameters:
string

 

Returns:true if, and only if, string is phone number.


isNotPhoneNumber

public static boolean isNotPhoneNumber(java.lang.String string)
Check whether a string is not phone number.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT phone number.


isBarcode

public static boolean isBarcode(java.lang.String string)
Check whether a string is barcode.

 

Parameters:
string

 

Returns:true if, and only if, string is barcode.


isNotBarcode

public static boolean isNotBarcode(java.lang.String string)
Check whether a string is not barcode.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT barcode.


isIp

public static boolean isIp(java.lang.String string)
Check whether a string is IP.

 

Parameters:
string

 

Returns:true if, and only if, string is IP.


isNotIp

public static boolean isNotIp(java.lang.String string)
Check whether a string is not IP.

 

Parameters:
string

 

Returns:true if, and only if, string is NOT IP.


hasBelowLength

public static boolean hasBelowLength(java.lang.String string,
                                     int minLength)
Check whether a string has length below minLength.

 

Parameters:
string
minLength

 

Returns:true if, and only if, string.length() < minLength.


isSureDataNotSaved

public static boolean isSureDataNotSaved()
Same as :
 CCMessage.showYesNoWarning(CCMessage.WARNING_DATA_NOT_SAVED()) == JOptionPane.YES_OPTION;

 

Returns:
boolean

 


isSureSave

public static boolean isSureSave()
Same as :
 CCMessage.showYesNoQuestion(CCMessage.ASK_SAVE()) == JOptionPane.YES_OPTION;

 

Returns:
boolean

 


isSureHide

public static boolean isSureHide()
Same as :
 CCMessage.showYesNoQuestion(CCMessage.ASK_HIDE()) == JOptionPane.YES_OPTION;

 

Returns:
boolean

 


isSureDelete

public static boolean isSureDelete()
Same as :
 CCMessage.showYesNoQuestion(CCMessage.ASK_DELETE()) == JOptionPane.YES_OPTION;

 

Returns:
boolean

 

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: