本文整理了Java中com.esotericsoftware.kryo.util.Util.isClassAvailable()
方法的一些代码示例,展示了Util.isClassAvailable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isClassAvailable()
方法的具体详情如下:
包路径:com.esotericsoftware.kryo.util.Util
类名称:Util
方法名:isClassAvailable
暂无
代码示例来源:origin: com.esotericsoftware/kryo
public static void addDefaultSerializers (Kryo kryo) {
if (isClassAvailable("java.util.Optional")) kryo.addDefaultSerializer(Optional.class, new OptionalSerializer());
if (isClassAvailable("java.util.OptionalInt")) kryo.addDefaultSerializer(OptionalInt.class, new OptionalIntSerializer());
if (isClassAvailable("java.util.OptionalLong")) kryo.addDefaultSerializer(OptionalLong.class, new OptionalLongSerializer());
if (isClassAvailable("java.util.OptionalDouble"))
kryo.addDefaultSerializer(OptionalDouble.class, new OptionalDoubleSerializer());
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
public static void addDefaultSerializers (Kryo kryo) {
if (isClassAvailable("java.util.Optional")) kryo.addDefaultSerializer(Optional.class, new OptionalSerializer());
if (isClassAvailable("java.util.OptionalInt")) kryo.addDefaultSerializer(OptionalInt.class, new OptionalIntSerializer());
if (isClassAvailable("java.util.OptionalLong")) kryo.addDefaultSerializer(OptionalLong.class, new OptionalLongSerializer());
if (isClassAvailable("java.util.OptionalDouble"))
kryo.addDefaultSerializer(OptionalDouble.class, new OptionalDoubleSerializer());
}
代码示例来源:origin: com.esotericsoftware/kryo
public static void addDefaultSerializers (Kryo kryo) {
if (isClassAvailable("java.time.Duration")) kryo.addDefaultSerializer(Duration.class, new DurationSerializer());
if (isClassAvailable("java.time.Instant")) kryo.addDefaultSerializer(Instant.class, new InstantSerializer());
if (isClassAvailable("java.time.LocalDate")) kryo.addDefaultSerializer(LocalDate.class, new LocalDateSerializer());
if (isClassAvailable("java.time.LocalTime")) kryo.addDefaultSerializer(LocalTime.class, new LocalTimeSerializer());
if (isClassAvailable("java.time.LocalDateTime"))
kryo.addDefaultSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
if (isClassAvailable("java.time.ZoneOffset")) kryo.addDefaultSerializer(ZoneOffset.class, new ZoneOffsetSerializer());
if (isClassAvailable("java.time.ZoneId")) kryo.addDefaultSerializer(ZoneId.class, new ZoneIdSerializer());
if (isClassAvailable("java.time.OffsetTime")) kryo.addDefaultSerializer(OffsetTime.class, new OffsetTimeSerializer());
if (isClassAvailable("java.time.OffsetDateTime"))
kryo.addDefaultSerializer(OffsetDateTime.class, new OffsetDateTimeSerializer());
if (isClassAvailable("java.time.ZonedDateTime"))
kryo.addDefaultSerializer(ZonedDateTime.class, new ZonedDateTimeSerializer());
if (isClassAvailable("java.time.Year")) kryo.addDefaultSerializer(Year.class, new YearSerializer());
if (isClassAvailable("java.time.YearMonth")) kryo.addDefaultSerializer(YearMonth.class, new YearMonthSerializer());
if (isClassAvailable("java.time.MonthDay")) kryo.addDefaultSerializer(MonthDay.class, new MonthDaySerializer());
if (isClassAvailable("java.time.Period")) kryo.addDefaultSerializer(Period.class, new PeriodSerializer());
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
public static void addDefaultSerializers (Kryo kryo) {
if (isClassAvailable("java.time.Duration")) kryo.addDefaultSerializer(Duration.class, new DurationSerializer());
if (isClassAvailable("java.time.Instant")) kryo.addDefaultSerializer(Instant.class, new InstantSerializer());
if (isClassAvailable("java.time.LocalDate")) kryo.addDefaultSerializer(LocalDate.class, new LocalDateSerializer());
if (isClassAvailable("java.time.LocalTime")) kryo.addDefaultSerializer(LocalTime.class, new LocalTimeSerializer());
if (isClassAvailable("java.time.LocalDateTime"))
kryo.addDefaultSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
if (isClassAvailable("java.time.ZoneOffset")) kryo.addDefaultSerializer(ZoneOffset.class, new ZoneOffsetSerializer());
if (isClassAvailable("java.time.ZoneId")) kryo.addDefaultSerializer(ZoneId.class, new ZoneIdSerializer());
if (isClassAvailable("java.time.OffsetTime")) kryo.addDefaultSerializer(OffsetTime.class, new OffsetTimeSerializer());
if (isClassAvailable("java.time.OffsetDateTime"))
kryo.addDefaultSerializer(OffsetDateTime.class, new OffsetDateTimeSerializer());
if (isClassAvailable("java.time.ZonedDateTime"))
kryo.addDefaultSerializer(ZonedDateTime.class, new ZonedDateTimeSerializer());
if (isClassAvailable("java.time.Year")) kryo.addDefaultSerializer(Year.class, new YearSerializer());
if (isClassAvailable("java.time.YearMonth")) kryo.addDefaultSerializer(YearMonth.class, new YearMonthSerializer());
if (isClassAvailable("java.time.MonthDay")) kryo.addDefaultSerializer(MonthDay.class, new MonthDaySerializer());
if (isClassAvailable("java.time.Period")) kryo.addDefaultSerializer(Period.class, new PeriodSerializer());
}
内容来源于网络,如有侵权,请联系作者删除!