java.time.temporal.UnsupportedTemporalTypeException类的使用及代码示例

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

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

UnsupportedTemporalTypeException介绍

[英]An exception that indicates a type is unsupported.

Specification for implementors

This class is intended for use in a single thread.
[中]表示不支持某个类型的异常。
####实施者规范
此类用于单个线程。

代码示例

代码示例来源:origin: neo4j/neo4j

@Override
ZoneId getZoneId()
{
  throw new UnsupportedTemporalTypeException( "Cannot get the timezone of" + this );
}

代码示例来源:origin: neo4j/neo4j

@Override
public final int get( TemporalField field )
{
  int accessor;
  try
  {
   accessor = temporal().get( field );
  }
  catch ( UnsupportedTemporalTypeException e )
  {
    throw new UnsupportedTemporalUnitException( e.getMessage(), e );
  }
  return accessor;
}

代码示例来源:origin: jtablesaw/tablesaw

throw new UnsupportedTemporalTypeException("Unit is too large to be used for truncation");

代码示例来源:origin: neo4j/neo4j

private static long assertValidUntil( Temporal from, Temporal to, TemporalUnit unit )
{
  try
  {
    return from.until( to, unit );
  }
  catch ( UnsupportedTemporalTypeException e )
  {
    throw new UnsupportedTemporalUnitException( e.getMessage(), e );
  }
  catch ( DateTimeException e )
  {
    throw new InvalidValuesArgumentException( e.getMessage(), e );
  }
}

代码示例来源:origin: jtablesaw/tablesaw

numberColumn.append(result); break;
default:
  throw new UnsupportedTemporalTypeException("The ChronoUnit " + unit + " is not supported for timeWindows on times");

代码示例来源:origin: neo4j/neo4j

throw new UnsupportedTemporalUnitException( e.getMessage(), e );

代码示例来源:origin: jtablesaw/tablesaw

break;
default:
  throw new UnsupportedTemporalTypeException("Type " + unit + " is not currently supported");

代码示例来源:origin: org.neo4j/neo4j-values

@Override
public final int get( TemporalField field )
{
  int accessor;
  try
  {
   accessor = temporal().get( field );
  }
  catch ( UnsupportedTemporalTypeException e )
  {
    throw new UnsupportedTemporalUnitException( e.getMessage(), e );
  }
  return accessor;
}

代码示例来源:origin: jtablesaw/tablesaw

break;
default:
  throw new UnsupportedTemporalTypeException("Type " + unit + " is not currently supported");

代码示例来源:origin: org.neo4j/neo4j-values

private static long assertValidUntil( Temporal from, Temporal to, TemporalUnit unit )
{
  try
  {
    return from.until( to, unit );
  }
  catch ( UnsupportedTemporalTypeException e )
  {
    throw new UnsupportedTemporalUnitException( e.getMessage(), e );
  }
  catch ( DateTimeException e )
  {
    throw new InvalidValuesArgumentException( e.getMessage(), e );
  }
}

代码示例来源:origin: jtablesaw/tablesaw

break;
default:
  throw new UnsupportedTemporalTypeException("Type " + unit + " is not currently supported");

代码示例来源:origin: jtablesaw/tablesaw

numberColumn.set(i, result); break;
default:
  throw new UnsupportedTemporalTypeException("The ChronoUnit " + unit + " is not supported for timeWindows on dates");

代码示例来源:origin: jtablesaw/tablesaw

numberColumn.set(i, result); break;
default:
  throw new UnsupportedTemporalTypeException("The ChronoUnit " + unit + " is not supported for timeWindows on dates");

代码示例来源:origin: org.neo4j/neo4j-values

@Override
ZoneId getZoneId()
{
  throw new UnsupportedTemporalTypeException( "Cannot get the timezone of" + this );
}

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public long getLong(TemporalField field) {
  throw new UnsupportedTemporalTypeException("Unsupported field: " + field);
}
@SuppressWarnings("unchecked")

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public long get(TemporalUnit unit) {
  if (unit == YEARS) {
    return years;
  }
  if (unit == MONTHS) {
    return months;
  }
  if (unit == DAYS) {
    return days;
  }
  throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
}

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public long get(TemporalUnit unit) {
  if (unit == SECONDS) {
    return seconds;
  }
  if (unit == NANOS) {
    return nanos;
  }
  throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
}

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public long getLong(TemporalField field) {
  throw new UnsupportedTemporalTypeException("Unsupported field: " + field);
}
@SuppressWarnings("unchecked")

代码示例来源:origin: com.datastax.oss/java-driver-core-shaded

@Override
public long get(TemporalUnit unit) {
 if (unit == ChronoUnit.MONTHS) {
  return months;
 } else if (unit == ChronoUnit.DAYS) {
  return days;
 } else if (unit == ChronoUnit.NANOS) {
  return nanoseconds;
 } else {
  throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
 }
}

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public long get(TemporalUnit unit) {
  if (unit == YEARS) {
    return years;
  }
  if (unit == MONTHS) {
    return months;
  }
  if (unit == DAYS) {
    return days;
  }
  throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
}

相关文章

微信公众号

最新文章

更多

UnsupportedTemporalTypeException类方法