当前位置: 首页>>代码示例>>Java>>正文


Java NonNull类代码示例

本文整理汇总了Java中net.kyori.blizzard.NonNull的典型用法代码示例。如果您正苦于以下问题:Java NonNull类的具体用法?Java NonNull怎么用?Java NonNull使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NonNull类属于net.kyori.blizzard包,在下文中一共展示了NonNull类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createArgument

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
private static <T> Argument createArgument(@NonNull final Binder binder, @NonNull final Type type, @NonNull final List<? extends Annotation> annotations) {
  @Nullable Annotation classifier = null;
  final List<Annotation> modifiers = new ArrayList<>();

  for(final Annotation annotation : annotations) {
    // Capture a classifier if an annotation is annotated
    if(annotation.annotationType().getAnnotation(Classifier.class) != null) {
      classifier = annotation;
    } else {
      modifiers.add(annotation);
    }
  }

  @Nullable final Binding<T> binding = binder.binding(BindingKey.of(type, classifier != null ? classifier.annotationType() : null));
  if(binding == null) {
    throw new IllegalArgumentException("Could not find a binding for argument type '" + type + "' with modifiers " + annotations);
  }

  return new Argument(binding.provider(), modifiers);
}
 
开发者ID:KyoriPowered,项目名称:ghost,代码行数:22,代码来源:ArgumentParser.java

示例2: put

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
<T> void put(@NonNull final BindingKey<T> key, @NonNull final Provider<T> provider) {
  if(this.bindings.containsKey(key)) {
    throw new IllegalStateException("A binding for " + key + " already exists");
  }
  this.bindings.put(key, new Binding<T>() {
    @NonNull
    @Override
    public BindingKey<T> key() {
      return key;
    }

    @NonNull
    @Override
    public Provider<T> provider() {
      return provider;
    }
  });
}
 
开发者ID:KyoriPowered,项目名称:ghost,代码行数:19,代码来源:BinderBuilder.java

示例3: annotatedWith

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public Binding.Builder<T> annotatedWith(@Nullable final Class<? extends Annotation> annotation) {
  if(annotation != null) {
    checkArgument(annotation.getAnnotation(Classifier.class) != null, "The '@%s' annotation must be decorated with '@%s' to be used as a classifier", annotation.getName(), Classifier.class.getName());
  }
  return new BindingBuilder<>(this.binder, this.key.classifier(annotation));
}
 
开发者ID:KyoriPowered,项目名称:ghost,代码行数:9,代码来源:BinderBuilder.java

示例4: map

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public MuVector2i map(@NonNull final IntUnaryOperator operator) {
  this.x = operator.applyAsInt(this.x);
  this.y = operator.applyAsInt(this.y);
  return this;
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:8,代码来源:MuVector2i.java

示例5: pow

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public MuVector2i pow(final int power) {
  this.x = Mth.floor(Math.pow(this.x, power));
  this.y = Mth.floor(Math.pow(this.y, power));
  return this;
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:8,代码来源:MuVector2i.java

示例6: sub

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public ImVector4l sub(final long x, final long y, final long z, final long w) {
  if(x == 0 && y == 0 && z == 0 && w == 0) {
    return this;
  }
  return of(this.x - x, this.y - y, this.z - z, this.w - w);
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:9,代码来源:ImVector4l.java

示例7: append

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public KeybindComponent append(@NonNull final Component component) {
  this.detectCycle(component); // detect cycle before modifying
  final List<Component> children = new ArrayList<>(this.children.size() + 1);
  children.addAll(this.children);
  children.add(component);
  return new KeybindComponent(children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, this.clickEvent, this.hoverEvent, this.insertion, this.keybind);
}
 
开发者ID:KyoriPowered,项目名称:text,代码行数:10,代码来源:KeybindComponent.java

示例8: div

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public MuVector2i div(final int x, final int y) {
  this.x /= x;
  this.y /= y;
  return this;
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:8,代码来源:MuVector2i.java

示例9: add

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public ImVector3l add(final long x, final long y, final long z) {
  if(x == 0 && y == 0 && z == 0) {
    return this;
  }
  return of(this.x + x, this.y + y, this.z + z);
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:9,代码来源:ImVector3l.java

示例10: AbstractComponent

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
protected AbstractComponent(@NonNull final List<Component> children, @Nullable final TextColor color, @NonNull final TextDecoration.State obfuscated, @NonNull final TextDecoration.State bold, @NonNull final TextDecoration.State strikethrough, @NonNull final TextDecoration.State underlined, @NonNull final TextDecoration.State italic, @Nullable final ClickEvent clickEvent, @Nullable final HoverEvent hoverEvent, @Nullable final String insertion) {
  this.children = ImmutableList.copyOf(children);
  this.color = color;
  this.obfuscated = obfuscated;
  this.bold = bold;
  this.strikethrough = strikethrough;
  this.underlined = underlined;
  this.italic = italic;
  this.clickEvent = clickEvent;
  this.hoverEvent = hoverEvent;
  this.insertion = insertion;
}
 
开发者ID:KyoriPowered,项目名称:text,代码行数:13,代码来源:AbstractComponent.java

示例11: negate

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public MuMatrix3f negate() {
  this.m00 = -this.m00;
  this.m01 = -this.m01;
  this.m02 = -this.m02;
  this.m10 = -this.m10;
  this.m11 = -this.m11;
  this.m12 = -this.m12;
  this.m20 = -this.m20;
  this.m21 = -this.m21;
  this.m22 = -this.m22;
  return this;
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:15,代码来源:MuMatrix3f.java

示例12: negate

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public ImMatrix3f negate() {
  return of(
    -this.m00, -this.m01, -this.m02,
    -this.m10, -this.m11, -this.m12,
    -this.m20, -this.m21, -this.m22
  );
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:10,代码来源:ImMatrix3f.java

示例13: configure

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@Override
public final void configure(@NonNull final Binder.Builder builder) {
  checkState(this.builder == null, "Re-entry is not permitted");
  this.builder = builder;
  try {
    this.configure();
  } finally {
    this.builder = null;
  }
}
 
开发者ID:KyoriPowered,项目名称:ghost,代码行数:11,代码来源:AbstractModule.java

示例14: negate

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public MuVector3d negate() {
  this.x = -this.x;
  this.y = -this.y;
  this.z = -this.z;
  return this;
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:9,代码来源:MuVector3d.java

示例15: lerp

import net.kyori.blizzard.NonNull; //导入依赖的package包/类
@NonNull
@Override
public MuVector4d lerp(@NonNull final Vector4d vec, final double n) {
  final double u = 1 - n;
  this.x = u * this.x + n * vec.x();
  this.y = u * this.y + n * vec.y();
  this.z = u * this.z + n * vec.z();
  this.w = u * this.w + n * vec.w();
  return this;
}
 
开发者ID:KyoriPowered,项目名称:math,代码行数:11,代码来源:MuVector4d.java


注:本文中的net.kyori.blizzard.NonNull类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。