NullOps.java

net.minecraft.util.NullOps

信息

  • 全限定名:net.minecraft.util.NullOps
  • 类型:public class
  • 包:net.minecraft.util
  • 源码路径:src/main/java/net/minecraft/util/NullOps.java
  • 起始行号:L20
  • 实现:DynamicOps
  • 职责:

    TODO

字段/常量

  • INSTANCE

    • 类型: NullOps
    • 修饰符: public static final
    • 源码定位: L21
    • 说明:

      TODO

  • EMPTY_MAP

    • 类型: MapLike<Unit>
    • 修饰符: private static final public public public
    • 源码定位: L22
    • 说明:

      TODO

内部类/嵌套类型

  • net.minecraft.util.NullOps.NullListBuilder

    • 类型: class
    • 修饰符: private static final
    • 源码定位: L199
    • 说明:

      TODO

  • net.minecraft.util.NullOps.NullMapBuilder

    • 类型: class
    • 修饰符: private static final
    • 源码定位: L217
    • 说明:

      TODO

构造器

private NullOps() @ L37

  • 构造器名:NullOps
  • 源码定位:L37
  • 修饰符:private

参数:

说明:

TODO

方法

下面的方法块按源码顺序生成。

public <U> U convertTo(DynamicOps<U> outOps, Unit input) @ L40

  • 方法名:convertTo
  • 源码定位:L40
  • 返回类型: U
  • 修饰符:public

参数:

  • outOps: DynamicOps
  • input: Unit

说明:

TODO

public Unit empty() @ L44

  • 方法名:empty
  • 源码定位:L44
  • 返回类型:Unit
  • 修饰符:public

参数:

说明:

TODO

public Unit emptyMap() @ L48

  • 方法名:emptyMap
  • 源码定位:L48
  • 返回类型:Unit
  • 修饰符:public

参数:

说明:

TODO

public Unit emptyList() @ L52

  • 方法名:emptyList
  • 源码定位:L52
  • 返回类型:Unit
  • 修饰符:public

参数:

说明:

TODO

public Unit createNumeric(Number value) @ L56

  • 方法名:createNumeric
  • 源码定位:L56
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: Number

说明:

TODO

public Unit createByte(byte value) @ L60

  • 方法名:createByte
  • 源码定位:L60
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: byte

说明:

TODO

public Unit createShort(short value) @ L64

  • 方法名:createShort
  • 源码定位:L64
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: short

说明:

TODO

public Unit createInt(int value) @ L68

  • 方法名:createInt
  • 源码定位:L68
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: int

说明:

TODO

public Unit createLong(long value) @ L72

  • 方法名:createLong
  • 源码定位:L72
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: long

说明:

TODO

public Unit createFloat(float value) @ L76

  • 方法名:createFloat
  • 源码定位:L76
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: float

说明:

TODO

public Unit createDouble(double value) @ L80

  • 方法名:createDouble
  • 源码定位:L80
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: double

说明:

TODO

public Unit createBoolean(boolean value) @ L84

  • 方法名:createBoolean
  • 源码定位:L84
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: boolean

说明:

TODO

public Unit createString(String value) @ L88

  • 方法名:createString
  • 源码定位:L88
  • 返回类型:Unit
  • 修饰符:public

参数:

  • value: String

说明:

TODO

public DataResult<Number> getNumberValue(Unit input) @ L92

  • 方法名:getNumberValue
  • 源码定位:L92
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<Boolean> getBooleanValue(Unit input) @ L96

  • 方法名:getBooleanValue
  • 源码定位:L96
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<String> getStringValue(Unit input) @ L100

  • 方法名:getStringValue
  • 源码定位:L100
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<Unit> mergeToList(Unit input, Unit value) @ L104

  • 方法名:mergeToList
  • 源码定位:L104
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit
  • value: Unit

说明:

TODO

public DataResult<Unit> mergeToList(Unit input, List<Unit> values) @ L108

  • 方法名:mergeToList
  • 源码定位:L108
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit
  • values: List

说明:

TODO

public DataResult<Unit> mergeToMap(Unit input, Unit key, Unit value) @ L112

  • 方法名:mergeToMap
  • 源码定位:L112
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit
  • key: Unit
  • value: Unit

说明:

TODO

public DataResult<Unit> mergeToMap(Unit input, Map<Unit,Unit> values) @ L116

  • 方法名:mergeToMap
  • 源码定位:L116
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit
  • values: Map<Unit,Unit>

说明:

TODO

public DataResult<Unit> mergeToMap(Unit input, MapLike<Unit> values) @ L120

  • 方法名:mergeToMap
  • 源码定位:L120
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit
  • values: MapLike

说明:

TODO

public DataResult<Stream<Pair<Unit,Unit>>> getMapValues(Unit input) @ L124

  • 方法名:getMapValues
  • 源码定位:L124
  • 返回类型:DataResult<Stream<Pair<Unit,Unit>>>
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<Consumer<BiConsumer<Unit,Unit>>> getMapEntries(Unit input) @ L128

  • 方法名:getMapEntries
  • 源码定位:L128
  • 返回类型:DataResult<Consumer<BiConsumer<Unit,Unit>>>
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<MapLike<Unit>> getMap(Unit input) @ L132

  • 方法名:getMap
  • 源码定位:L132
  • 返回类型:DataResult<MapLike>
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<Stream<Unit>> getStream(Unit input) @ L136

  • 方法名:getStream
  • 源码定位:L136
  • 返回类型:DataResult<Stream>
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<Consumer<Consumer<Unit>>> getList(Unit input) @ L140

  • 方法名:getList
  • 源码定位:L140
  • 返回类型:DataResult<Consumer<Consumer>>
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<ByteBuffer> getByteBuffer(Unit input) @ L144

  • 方法名:getByteBuffer
  • 源码定位:L144
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<IntStream> getIntStream(Unit input) @ L148

  • 方法名:getIntStream
  • 源码定位:L148
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public DataResult<LongStream> getLongStream(Unit input) @ L152

  • 方法名:getLongStream
  • 源码定位:L152
  • 返回类型:DataResult
  • 修饰符:public

参数:

  • input: Unit

说明:

TODO

public Unit createMap(Stream<Pair<Unit,Unit>> map) @ L156

  • 方法名:createMap
  • 源码定位:L156
  • 返回类型:Unit
  • 修饰符:public

参数:

  • map: Stream<Pair<Unit,Unit>>

说明:

TODO

public Unit createMap(Map<Unit,Unit> map) @ L160

  • 方法名:createMap
  • 源码定位:L160
  • 返回类型:Unit
  • 修饰符:public

参数:

  • map: Map<Unit,Unit>

说明:

TODO

public Unit createList(Stream<Unit> input) @ L164

  • 方法名:createList
  • 源码定位:L164
  • 返回类型:Unit
  • 修饰符:public

参数:

  • input: Stream

说明:

TODO

public Unit createByteList(ByteBuffer input) @ L168

  • 方法名:createByteList
  • 源码定位:L168
  • 返回类型:Unit
  • 修饰符:public

参数:

  • input: ByteBuffer

说明:

TODO

public Unit createIntList(IntStream input) @ L172

  • 方法名:createIntList
  • 源码定位:L172
  • 返回类型:Unit
  • 修饰符:public

参数:

  • input: IntStream

说明:

TODO

public Unit createLongList(LongStream input) @ L176

  • 方法名:createLongList
  • 源码定位:L176
  • 返回类型:Unit
  • 修饰符:public

参数:

  • input: LongStream

说明:

TODO

public Unit remove(Unit input, String key) @ L180

  • 方法名:remove
  • 源码定位:L180
  • 返回类型:Unit
  • 修饰符:public

参数:

  • input: Unit
  • key: String

说明:

TODO

public RecordBuilder<Unit> mapBuilder() @ L184

  • 方法名:mapBuilder
  • 源码定位:L184
  • 返回类型:RecordBuilder
  • 修饰符:public

参数:

说明:

TODO

public ListBuilder<Unit> listBuilder() @ L189

  • 方法名:listBuilder
  • 源码定位:L189
  • 返回类型:ListBuilder
  • 修饰符:public

参数:

说明:

TODO

public String toString() @ L194

  • 方法名:toString
  • 源码定位:L194
  • 返回类型:String
  • 修饰符:public

参数:

说明:

TODO

代码

public class NullOps implements DynamicOps<Unit> {
    public static final NullOps INSTANCE = new NullOps();
    private static final MapLike<Unit> EMPTY_MAP = new MapLike<Unit>() {
        public @Nullable Unit get(Unit key) {
            return null;
        }
 
        public @Nullable Unit get(String key) {
            return null;
        }
 
        @Override
        public Stream<Pair<Unit, Unit>> entries() {
            return Stream.empty();
        }
    };
 
    private NullOps() {
    }
 
    public <U> U convertTo(DynamicOps<U> outOps, Unit input) {
        return outOps.empty();
    }
 
    public Unit empty() {
        return Unit.INSTANCE;
    }
 
    public Unit emptyMap() {
        return Unit.INSTANCE;
    }
 
    public Unit emptyList() {
        return Unit.INSTANCE;
    }
 
    public Unit createNumeric(Number value) {
        return Unit.INSTANCE;
    }
 
    public Unit createByte(byte value) {
        return Unit.INSTANCE;
    }
 
    public Unit createShort(short value) {
        return Unit.INSTANCE;
    }
 
    public Unit createInt(int value) {
        return Unit.INSTANCE;
    }
 
    public Unit createLong(long value) {
        return Unit.INSTANCE;
    }
 
    public Unit createFloat(float value) {
        return Unit.INSTANCE;
    }
 
    public Unit createDouble(double value) {
        return Unit.INSTANCE;
    }
 
    public Unit createBoolean(boolean value) {
        return Unit.INSTANCE;
    }
 
    public Unit createString(String value) {
        return Unit.INSTANCE;
    }
 
    public DataResult<Number> getNumberValue(Unit input) {
        return DataResult.success(0);
    }
 
    public DataResult<Boolean> getBooleanValue(Unit input) {
        return DataResult.success(false);
    }
 
    public DataResult<String> getStringValue(Unit input) {
        return DataResult.success("");
    }
 
    public DataResult<Unit> mergeToList(Unit input, Unit value) {
        return DataResult.success(Unit.INSTANCE);
    }
 
    public DataResult<Unit> mergeToList(Unit input, List<Unit> values) {
        return DataResult.success(Unit.INSTANCE);
    }
 
    public DataResult<Unit> mergeToMap(Unit input, Unit key, Unit value) {
        return DataResult.success(Unit.INSTANCE);
    }
 
    public DataResult<Unit> mergeToMap(Unit input, Map<Unit, Unit> values) {
        return DataResult.success(Unit.INSTANCE);
    }
 
    public DataResult<Unit> mergeToMap(Unit input, MapLike<Unit> values) {
        return DataResult.success(Unit.INSTANCE);
    }
 
    public DataResult<Stream<Pair<Unit, Unit>>> getMapValues(Unit input) {
        return DataResult.success(Stream.empty());
    }
 
    public DataResult<Consumer<BiConsumer<Unit, Unit>>> getMapEntries(Unit input) {
        return DataResult.success(consumer -> {});
    }
 
    public DataResult<MapLike<Unit>> getMap(Unit input) {
        return DataResult.success(EMPTY_MAP);
    }
 
    public DataResult<Stream<Unit>> getStream(Unit input) {
        return DataResult.success(Stream.empty());
    }
 
    public DataResult<Consumer<Consumer<Unit>>> getList(Unit input) {
        return DataResult.success(consumer -> {});
    }
 
    public DataResult<ByteBuffer> getByteBuffer(Unit input) {
        return DataResult.success(ByteBuffer.wrap(new byte[0]));
    }
 
    public DataResult<IntStream> getIntStream(Unit input) {
        return DataResult.success(IntStream.empty());
    }
 
    public DataResult<LongStream> getLongStream(Unit input) {
        return DataResult.success(LongStream.empty());
    }
 
    public Unit createMap(Stream<Pair<Unit, Unit>> map) {
        return Unit.INSTANCE;
    }
 
    public Unit createMap(Map<Unit, Unit> map) {
        return Unit.INSTANCE;
    }
 
    public Unit createList(Stream<Unit> input) {
        return Unit.INSTANCE;
    }
 
    public Unit createByteList(ByteBuffer input) {
        return Unit.INSTANCE;
    }
 
    public Unit createIntList(IntStream input) {
        return Unit.INSTANCE;
    }
 
    public Unit createLongList(LongStream input) {
        return Unit.INSTANCE;
    }
 
    public Unit remove(Unit input, String key) {
        return input;
    }
 
    @Override
    public RecordBuilder<Unit> mapBuilder() {
        return new NullOps.NullMapBuilder(this);
    }
 
    @Override
    public ListBuilder<Unit> listBuilder() {
        return new NullOps.NullListBuilder(this);
    }
 
    @Override
    public String toString() {
        return "Null";
    }
 
    private static final class NullListBuilder extends AbstractListBuilder<Unit, Unit> {
        public NullListBuilder(DynamicOps<Unit> ops) {
            super(ops);
        }
 
        protected Unit initBuilder() {
            return Unit.INSTANCE;
        }
 
        protected Unit append(Unit builder, Unit value) {
            return builder;
        }
 
        protected DataResult<Unit> build(Unit builder, Unit prefix) {
            return DataResult.success(builder);
        }
    }
 
    private static final class NullMapBuilder extends AbstractUniversalBuilder<Unit, Unit> {
        public NullMapBuilder(DynamicOps<Unit> ops) {
            super(ops);
        }
 
        protected Unit initBuilder() {
            return Unit.INSTANCE;
        }
 
        protected Unit append(Unit key, Unit value, Unit builder) {
            return builder;
        }
 
        protected DataResult<Unit> build(Unit builder, Unit prefix) {
            return DataResult.success(prefix);
        }
    }
}

引用的其他类

  • CollectToTag

    • 引用位置: 返回值
  • Unit

    • 引用位置: 参数/字段/实现/返回值