Class CommonUtil
java.lang.Object
com.github.unafraid.telegrambot.util.CommonUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic <T extends Enum<T>>
booleanstatic booleanstatic booleanstatic int
-
Constructor Details
-
CommonUtil
public CommonUtil()
-
-
Method Details
-
parseInt
- Parameters:
intValue- the valuedefaultValue- the default value- Returns:
- intValue as int if its valid integer value, defaultValue otherwise
-
isDigit
- Parameters:
text- the text- Returns:
trueif text can be parsed as long,false
-
isInteger
- Parameters:
text- - the text to check- Returns:
trueiftextis integer,falseotherwise
-
isFloat
- Parameters:
text- - the text to check- Returns:
trueiftextis float,falseotherwise
-
isDouble
- Parameters:
text- - the text to check- Returns:
trueiftextis double,falseotherwise
-
isEnum
- Type Parameters:
T- the type- Parameters:
name- the text to checkenumType- the enum type- Returns:
trueiftextis enum,falseotherwise
-