本文整理了Java中org.jetbrains.annotations.NotNull
类的一些代码示例,展示了NotNull
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NotNull
类的具体详情如下:
包路径:org.jetbrains.annotations.NotNull
类名称:NotNull
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@NotNull
protected abstract GoExecutor createExecutor(@NotNull Project project,
@Nullable Module module,
@NotNull String title,
@NotNull String filePath);
}
代码示例来源:origin: skylot/jadx
@NotNull
@Override
public ListIterator<E> listIterator(int index) {
throw new UnsupportedOperationException();
}
代码示例来源:origin: net.openhft/chronicle-engine
@NotNull @SuppressWarnings("ConstantConditions")
final ValueIn valueIn = inWire.readEventName(eventName);
@NotNull final ValueOut valueOut = out.writeEventName(CoreFields.reply);
valueOut.sequence(v -> underlyingCollection.forEach(e -> toWire.accept(v, e)));
return;
Jvm.warn().on(getClass(), e);
assert outWire.startUse();
try {
@NotNull final Bytes<?> outBytes = outWire.bytes();
long len = outBytes.writePosition();
if (len >= SIZE_OF_SIZE) {
String s = Wires.fromSizePrefixedBlobs((Wire) outWire);
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public final T read(@NotNull Bytes in, long size, @Nullable T using) {
if (using == null)
using = createInstance();
using.bytesStore(in.bytesStore(), in.readPosition(), size);
return using;
}
}
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public Long read(@NotNull Bytes in, long size, @Nullable Long using) {
return in.readLong();
}
代码示例来源:origin: oracle/opengrok
@NotNull
@Override
@SuppressWarnings("rawtypes")
public BytesRef read(Bytes in, long size, @Nullable BytesRef using) {
if (size < 0L || size > (long) Integer.MAX_VALUE) {
throw new IORuntimeException("byte[] size should be non-negative int, " +
size + " given. Memory corruption?");
}
int arrayLength = (int) size;
if (using == null) {
using = new BytesRef(new byte[arrayLength]);
} else if (using.bytes.length < arrayLength) {
using.bytes = new byte[arrayLength];
}
in.read(using.bytes, 0, arrayLength);
using.offset = 0;
using.length = arrayLength;
return using;
}
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public Integer read(@NotNull Bytes in, long size, @Nullable Integer using) {
return in.readInt();
}
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public T read(Bytes in, @Nullable T using) {
try {
return (T) new ObjectInputStream(in.inputStream()).readObject();
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public Double read(@NotNull Bytes in, long size, @Nullable Double using) {
return in.readDouble();
}
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public String read(Bytes in, @Nullable String using) {
if (in.readUtf8(sb)) {
return sb.toString();
} else {
throw new NullPointerException("BytesReader couldn't read null");
}
}
代码示例来源:origin: OpenHFT/Chronicle-Queue
@Nullable
ScanResult moveToIndex0(@NotNull final ExcerptContext ec, final long index) {
return null;
@NotNull final LongArrayValues array1 = arrayForAddress(wire, secondaryAddress);
long secondaryOffset = toAddress1(index);
ec.wire().bytes().readPositionUnlimited(fromAddress);
return ScanResult.FOUND;
} else {
代码示例来源:origin: net.openhft/chronicle-bytes
private static void readUtf8_SB1(
@org.jetbrains.annotations.NotNull @NotNull Bytes bytes, @org.jetbrains.annotations.NotNull @NotNull StringBuilder appendable, @org.jetbrains.annotations.NotNull @NotNull StopCharTester tester)
throws IOException, BufferUnderflowException {
@org.jetbrains.annotations.Nullable NativeBytesStore nb = (NativeBytesStore) bytes.bytesStore();
int i = 0, len = Maths.toInt32(bytes.readRemaining());
long address = nb.address + nb.translate(bytes.readPosition());
@org.jetbrains.annotations.Nullable Memory memory = nb.memory;
if (Jvm.isJava9Plus()) {
int appendableLength = appendable.capacity();
for (; i < len && i < appendableLength; i++) {
代码示例来源:origin: net.openhft/chronicle-bytes
public static void parse8bit_SB1(@org.jetbrains.annotations.NotNull @NotNull Bytes bytes, @org.jetbrains.annotations.NotNull @NotNull StringBuilder sb, int utflen)
throws BufferUnderflowException {
if (utflen > bytes.readRemaining())
throw new BufferUnderflowException();
@Nullable NativeBytesStore nbs = (NativeBytesStore) bytes.bytesStore();
long offset = bytes.readPosition();
int count = BytesInternal.parse8bit_SB1(offset, nbs, sb, utflen);
bytes.readSkip(count);
}
代码示例来源:origin: net.openhft/chronicle-engine
private void onRead0(@NotNull DocumentContext inDc, @NotNull WireOut out, @NotNull WireIn in) {
if (!YamlLogging.showHeartBeats()) {
prevLogMessage.append(currentLogMessage);
currentLogMessage.setLength(0);
logToBuffer(in, currentLogMessage, in.bytes().readPosition() - 4);
} else {
Jvm.debug().on(getClass(), "received data:\n" + in.bytes().toHexString());
@NotNull Consumer<WireType> wireTypeConsumer = wt -> {
wireType(wt);
checkWires(in.bytes(), out.bytes(), wireType());
@Nullable Map<String, UserStat> userMonitoringMap = getMonitoringMap();
if (userMonitoringMap != null) {
UserStat userStat = userMonitoringMap.get(sessionDetails.userId());
Jvm.warn().on(getClass(), in.readingPeekYaml() + "/n" + in.bytes().toDebugString(),
e);
代码示例来源:origin: net.openhft/chronicle-engine
private void writeToFile(@NotNull Path path, @NotNull BytesStore value) {
BytesStore<?, ByteBuffer> writingBytes;
if (value.underlyingObject() instanceof ByteBuffer) {
Buffers b = Buffers.BUFFERS.get();
Bytes<ByteBuffer> valueBuffer = b.valueBuffer;
valueBuffer.clear();
valueBuffer.write(value);
writingBytes = valueBuffer;
@NotNull File tmpFile = new File(file.getParentFile(), "." + file.getName() + "." + System.nanoTime());
try (@NotNull FileChannel fc = new FileOutputStream(tmpFile).getChannel()) {
@Nullable ByteBuffer byteBuffer = writingBytes.underlyingObject();
byteBuffer.position(0);
byteBuffer.limit((int) writingBytes.readLimit());
Jvm.debug().on(getClass(), "Unable to rename file " + fse);
try {
Thread.sleep(i * i * 2);
代码示例来源:origin: net.openhft/chronicle-map
@NotNull
@Override
public Boolean read(Bytes in, @Nullable Boolean using) {
return in.readByte() != 0;
}
代码示例来源:origin: net.openhft/chronicle-bytes
@NotNull
public Bytes acquireBytesForWrite(long position)
throws IOException, IllegalStateException, IllegalArgumentException {
@Nullable MappedBytesStore mbs = acquireByteStore(position);
@NotNull Bytes bytes = mbs.bytesForWrite();
bytes.writePosition(position);
mbs.release();
return bytes;
}
代码示例来源:origin: net.openhft/chronicle-engine
private void readMarshallable(String path, @NotNull WireIn wire) {
@NotNull StringBuilder name = new StringBuilder();
while (!wire.isEmpty()) {
@NotNull ValueIn in = wire.read(name);
long pos = wire.bytes().readPosition();
@NotNull String path2 = path + "/" + name;
if (wire.getValueIn().isTyped()) {
wire.bytes().readPosition(pos);
@Nullable Object o = in.typedMarshallable();
installableMap.put(path2, (Installable) o);
} else {
in.marshallable(w -> this.readMarshallable(path2, w));
}
}
}
代码示例来源:origin: net.openhft/chronicle-bytes
/**
* Convenience method so you don't need to release the BytesStore
*/
@NotNull
public Bytes acquireBytesForRead(long position)
throws IOException, IllegalStateException, IllegalArgumentException {
@Nullable MappedBytesStore mbs = acquireByteStore(position);
Bytes bytes = mbs.bytesForRead();
bytes.readPositionUnlimited(position);
mbs.release();
return bytes;
}
代码示例来源:origin: OpenHFT/Chronicle-Queue
@Override
public long recoverAndWriteHeader(@NotNull Wire wire, long timeoutMS, final LongValue lastPosition, Sequence sequence) throws UnrecoverableTimeoutException {
Bytes<?> bytes = wire.bytes();
long offset = bytes.writePosition();
int num = bytes.readVolatileInt(offset);
final long targetHeaderNumber = wire.headerNumber() + 1;
String msgStart = "Unable to write a header at header number: 0x" + Long.toHexString(targetHeaderNumber) + " position: " + offset;
if (Wires.isNotComplete(num)) {
if (bytes instanceof MappedBytes) {
MappedBytes mb = (MappedBytes) bytes;
sizeToSkip = Maths.toUInt31(mb.mappedFile().overlapSize() / 2);
long pos = bytes.writePosition();
try {
bytes.writeSkip(4);
final String debugMessage = "!! Skipped due to recovery of locked header !! By thread " +
Thread.currentThread().getName() + ", pid " + OS.getProcessId();
wire.getValueOut().text(debugMessage);
final StringWriter stackVisitor = new StringWriter();
new RuntimeException().printStackTrace(new PrintWriter(stackVisitor));
内容来源于网络,如有侵权,请联系作者删除!