com.esotericsoftware.kryo.util.Util.isClassAvailable()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中com.esotericsoftware.kryo.util.Util.isClassAvailable()方法的一些代码示例,展示了Util.isClassAvailable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isClassAvailable()方法的具体详情如下:
包路径:com.esotericsoftware.kryo.util.Util
类名称:Util
方法名:isClassAvailable

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());
}

相关文章