com.wizzardo.tools.misc.Unchecked.rethrow()方法的使用及代码示例

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

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

Unchecked.rethrow介绍

暂无

代码示例

代码示例来源:origin: com.wizzardo.tools/tools-evaluation

@Override
  public void set(Object instance, Object value) {
    try {
      method.invoke(instance, value);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    } catch (InvocationTargetException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-evaluation

@Override
  public Object get(Object instance) {
    try {
      return method.invoke(instance);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    } catch (InvocationTargetException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-evaluation

protected <T> T creteInstance(Class<T> clazz) {
  T t;
  try {
    t = clazz.newInstance();
  } catch (InstantiationException e) {
    throw Unchecked.rethrow(e);
  } catch (IllegalAccessException e) {
    throw Unchecked.rethrow(e);
  }
  return t;
}

代码示例来源:origin: wizzardo/tools

@Override
  public void set(Object instance, Object value) {
    try {
      method.invoke(instance, value);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    } catch (InvocationTargetException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
  public int getInteger(Object object) {
    try {
      return field.getInt(object);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
public void setObject(Object object, Object value) {
  try {
    field.set(object, value);
  } catch (IllegalAccessException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
  public Object getObject(Object object) {
    try {
      return field.get(object);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-evaluation

@Override
  public void set(Object instance, Object value) {
    try {
      field.set(instance, value);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
  public long getLong(Object object) {
    try {
      return field.getLong(object);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
public void setInteger(Object object, int value) {
  try {
    field.setInt(object, value);
  } catch (IllegalAccessException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-evaluation

private static Collection createNewCollection(Collection c) {
  try {
    Collection l = c.getClass().newInstance();
    l.addAll(c);
    return l;
  } catch (InstantiationException e) {
    throw Unchecked.rethrow(e);
  } catch (IllegalAccessException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
  public float getFloat(Object object) {
    try {
      return field.getFloat(object);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
public void setShort(Object object, short value) {
  try {
    field.setShort(object, value);
  } catch (IllegalAccessException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-security

public void asBytes(byte[] bytes, int offset) {
  try {
    hash.digest(bytes, offset, hash.getDigestLength());
  } catch (DigestException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
public void setByte(Object object, byte value) {
  try {
    field.setByte(object, value);
  } catch (IllegalAccessException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-reflection

@Override
  public byte getByte(Object object) {
    try {
      return field.getByte(object);
    } catch (IllegalAccessException e) {
      throw Unchecked.rethrow(e);
    }
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-http

public List<Cookie> getCookies(String url) {
  try {
    return getCookies(new URL(url));
  } catch (MalformedURLException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: com.wizzardo.tools/tools-collections

@Override
public void process(B b) {
  try {
    if (blocking)
      output.put(b);
    notifyIfWaiting();
  } catch (InterruptedException e) {
    throw Unchecked.rethrow(e);
  }
}

代码示例来源:origin: wizzardo/tools

protected A take() {
  try {
    return input.take();
  } catch (InterruptedException e) {
    throw Unchecked.rethrow(e);
  } finally {
    notifyIfWaiting();
  }
}

代码示例来源:origin: com.wizzardo/epoll

private static FieldReflection getByteBufferAddressReflection() {
  try {
    return new FieldReflectionFactory().create(Buffer.class, "address", true);
  } catch (NoSuchFieldException e) {
    throw Unchecked.rethrow(e);
  }
}

相关文章