List of usage examples for java.lang Long longValue
@HotSpotIntrinsicCandidate public long longValue()
From source file:com.persistent.cloudninja.controller.AuthFilterUtils.java
/** * @param cookie/* w w w.j a va 2 s. c o m*/ * @return */ private static boolean isACSSessionValidNow(Cookie cookie) { String authSessionStartTimeStr = getFieldValueFromCookie(cookie, CloudNinjaConstants.COOKIE_AUTH_SESSION_START_PREFIX); String authSessionEndTimeStr = getFieldValueFromCookie(cookie, CloudNinjaConstants.COOKIE_AUTH_SESSION_END_PREFIX); Long currentTime = new Date().getTime(); boolean retVal = false; if (authSessionStartTimeStr == null || authSessionEndTimeStr == null) { return false; } if (Long.parseLong(authSessionEndTimeStr) > currentTime.longValue()) { retVal = true; } return retVal; }
From source file:com.google.cloud.dataflow.examples.opinionanalysis.IndexerPipelineUtils.java
public static Integer parseDateToInteger(String s) { Integer result = null;/* w w w .ja v a 2 s. c o m*/ Long l = parseDateToLong(s); if (l != null) { result = getDateIdFromTimestamp(l.longValue()); } return result; }
From source file:de.cosmocode.collections.utility.Convert.java
private static Date doIntoDate(Object value, DateMode dateMode) { Preconditions.checkNotNull(dateMode, "DateMode"); if (value == null) return null; if (value instanceof Date) return Date.class.cast(value); if (value instanceof Calendar) return Calendar.class.cast(value).getTime(); final Long time = doIntoLong(value); return time == null || time.longValue() < 0 ? null : dateMode.parse(time.longValue()); }
From source file:de.cosmocode.collections.utility.Convert.java
/** * Parses a value of a generic type//from w ww. j av a2 s. co m * into a long. * * @param value the value being parsed * @param defaultValue the default value if value can't be parsed into a long * @return the parsed long or the defaultValue if value can't be parsed into a long */ public static long intoLong(Object value, long defaultValue) { final Long l = doIntoLong(value); return l == null ? defaultValue : l.longValue(); }
From source file:org.dbmfs.DbmfsUtil.java
public static Object deserializeType(Long value, String javaTypeName) { if (javaTypeName.equals("java.lang.Long")) { return value; }/* ww w.jav a 2s . c o m*/ if (javaTypeName.equals("java.sql.Date")) { return new java.sql.Date(value.longValue()); } if (javaTypeName.equals("java.sql.Timestamp")) { return new java.sql.Timestamp(value.longValue()); } if (javaTypeName.equals("java.sql.Time")) { return new java.sql.Time(value.longValue()); } return value; }
From source file:com.primovision.lutransport.core.util.TollCompanyTagUploadUtil.java
public static boolean isConversionRequired(Long tollCompanyId) { long tollCompnyIdLong = tollCompanyId.longValue(); // EZ Pass NY if (tollCompnyIdLong == 3 || tollCompnyIdLong == 7 || tollCompnyIdLong == 8) { return true; } else if (tollCompnyIdLong == 1 || tollCompnyIdLong == 5 || tollCompnyIdLong == 6) { // EZ Pass PA return true; } else if (tollCompnyIdLong == 10 || tollCompnyIdLong == 11 || tollCompnyIdLong == 12) { // IPAss return true; } else if (tollCompnyIdLong == 9) { // SunPass return true; } else {/*from w w w.j av a 2s . c o m*/ return false; } }
From source file:de.cosmocode.collections.utility.Convert.java
/** * Parses a value of a generic type/*from w w w .j a v a 2 s . co m*/ * into a long. * * @param value the value being parsed * @return the parsed long * @throws IllegalArgumentException if conversion failed */ public static long intoLong(Object value) { final Long l = doIntoLong(value); if (l == null) { throw fail(value, long.class); } else { return l.longValue(); } }
From source file:com.redhat.rhn.domain.user.UserFactory.java
/** * Gets a long value from the dataresult * @param dr The DataResult object containing the output * @param key The key for the output value * @return the long value/*from w w w . j a va 2 s . co m*/ */ private static long getLongValue(DataResult dr, String key) { Long id = (Long) ((Map) dr.get(0)).get(key); return id.longValue(); }
From source file:com.redhat.rhn.domain.user.UserFactory.java
/** * Method to determine whether a satellite has any users. Returns * true if satellite has one or more users, false otherwise. Also * returns false if this method is called on a hosted installation. * @return true if satellite has one or more users, false otherwise. *///from ww w . j a v a2 s .com public static boolean satelliteHasUsers() { SelectMode m = ModeFactory.getMode("User_queries", "user_count"); DataResult dr = m.execute(new HashMap<String, Object>()); Map row = (Map) dr.get(0); Long count = (Long) row.get("user_count"); return (count.longValue() > 0); }
From source file:com.egt.ejb.toolkit.ToolKitUtils.java
public static String getCopyright(Long cr) { long l = cr == null ? -1L : cr.longValue(); return l < 0 ? Bundle.getString("copyright.default") : l < 20000 ? Bundle.getString("copyright.general") : l < 30000 ? Bundle.getString("copyright.generic") : Bundle.getString("copyright.cliente"); }