Input:
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.util.function.Function;
import edu.uky.cs.nil.sabre.Exceptions;
import edu.uky.cs.nil.sabre.Fluent;
import edu.uky.cs.nil.sabre.Number;
import edu.uky.cs.nil.sabre.Settings;
import edu.uky.cs.nil.sabre.State;
import edu.uky.cs.nil.sabre.Utilities;
import edu.uky.cs.nil.sabre.io.DefaultParser;
import edu.uky.cs.nil.sabre.util.Unique;

Context:
src/edu/uky/cs/nil/sabre/logic/Arithmetic.java
package edu.uky.cs.nil.sabre.logic;

/**
 * An arithmetic expression is a {@link Numeric numeric expression} whose value
 * if the results of applying {@link Operator an arithmetic operation} to two
 * numeric values.
 *
 * @author Stephen G. Ware
 */
public class Arithmetic implements Numeric {

	/** Serial version ID */
	private static final long serialVersionUID = Settings.VERSION_UID;

	/**
	 * An arithmetic operator is a singleton object that specifies how to
	 * combine two numeric input values into a numeric output value.
	 *
	 * @author Stephen G. Ware
	 */
	public static abstract class Operator implements Comparable<Operator>, Serializable, Unique {

		/** Serial version ID */
		private static final long serialVersionUID = Arithmetic.serialVersionUID;

		private Operator() {}

		@Override
		public int compareTo(Operator other) {
			return hashCode() - other.hashCode();
		}

		/**
		 * Returns the result of applying this operator to two input values.
		 * If both values are numbers, this method calls {@link
		 * #calculate(Number, Number)}, otherwise this method returns {@link
		 * Unknown unknown}.
		 *
		 * @param left the value on the left of the arithmetic operator
		 * @param right the value on the right of the arithmetic operator
		 * @return the result of applying the arithmetic operation to the
		 * values
		 */
		public Value calculate(Value left, Value right) {
			if(left instanceof Number && right instanceof Number)
				return calculate((Number) left, (Number) right);
			else
				return Unknown.UNKNOWN;
		}

		/**
		 * This method is called from {@link #calculate(Value, Value)} when
		 * both values are {@link Number numbers} and returns the result of
		 * applying this operator to two numbers.
		 *
		 * @param left the number on the left of the arithmetic operator
		 * @param right the number on the right of the arithmetic operator
		 * @return the result of applying the arithmetic operation to the
		 * numbers
		 */
		protected abstract Number calculate(Number left, Number right);

		/**
		 * If an {@link Arithmetic arithmetic expression} using this operator
		 * and the given left and right values can be simplified (for example,
		 * if the left and right values are both {@link Value values}), this
		 * method returns the simplified expression. Otherwise, this method
		 * returns null.
		 *
		 * @param left the {@link Arithmetic#left left side} of an
		 * arithmetic expression using this operator
		 * @param right the {@link Arithmetic#right right side} of an
		 * arithmetic expression using this operator
		 * @return a simplified logical expression or null if the expression
		 * cannot be simplified
		 */
		public Expression simplify(Expression left, Expression right) {
			if(left instanceof Value && right instanceof Value)
				return calculate((Value) left, (Value) right);
			else
				return null;
		}

		/**
		 * Isolates a query {@link Fluent fluent} on the left side of a {@link
		 * Comparison comparison} which has an arithmetic expression using this
		 * operator {@link Comparison#left on its left}.
		 *
		 * @param query the fluent that should be isolated
		 * @param left the {@link Arithmetic#left left side of the arithmetic
		 * expression} which appears on the left side of the comparison
		 * @param right the {@link Arithmetic#right right side of the
		 * arithmetic expression} which appear on the left side of the
		 * comparison
		 * @param inequality the {@link Comparison.Operator comparison
		 * operator} used in the {@link Comparison comparison}
		 * @param rhs the {@link Comparison#right right side of the comparison}
		 * @return a comparison with the flight as its left side
		 */
		protected Expression isolate(Fluent query, Expression left, Expression right, Comparison.Operator inequality, Expression rhs) {
			throw Exceptions.cannotIsolate(query, new Comparison(inequality, new Arithmetic(this, left, right), rhs));
		}
	}

	/**
	 * An {@link Operator arithmetic operator} for adding the left and right
	 * sides of an {@link Arithmetic arithmetic expression}.
	 */
	public static final Operator ADD = new Operator() {

		/** Serial version ID */
		private static final long serialVersionUID = 1;

		@Override
		public int hashCode() {
			return 0;
		}

		@Override
		public String toString() {
			return DefaultParser.ADDITION_KEYWORD;
		}

		/**
		 * Adds two numbers.
		 *
		 * @param left the number on the left
		 * @param right the number on the right
		 * @return the result of adding the numbers
		 */
		@Override
		protected Number calculate(Number left, Number right) {
			return left.add(right);
		}

		@Override
		public Expression simplify(Expression left, Expression right) {
			if(left.equals(Number.ZERO))
				return right;
			else if(right.equals(Number.ZERO))
				return left;
			else
				return super.simplify(left, right);
		}

		@Override
		protected Expression isolate(Fluent query, Expression left, Expression right, Comparison.Operator inequality, Expression rhs) {
			if(left.occurs(query))
				return new Comparison(inequality, left, new Arithmetic(SUBTRACT, rhs, right)).isolate(query);
			else if(right.occurs(query))
				return new Comparison(inequality, new Arithmetic(this, right, left), rhs).isolate(query);
			else
				return super.isolate(query, left, right, inequality, rhs);
		}

		private Object readResolve() throws ObjectStreamException {
			return ADD;
		}
	};

	/**
	 * An {@link Operator arithmetic operator} for subtracting the right side
	 * of an {@link Arithmetic arithmetic expression} from the left.
	 */
	public static final Operator SUBTRACT = new Operator() {

		/** Serial version ID */
		private static final long serialVersionUID = 1;

		@Override
		public int hashCode() {
			return 1;
		}

		@Override
		public String toString() {

src/edu/uky/cs/nil/sabre/State.java
@FunctionalInterface
public interface State {

	/**
	 * Returns the value assigned to a fluent in the current state.
	 *
	 * @param fluent the fluent
	 * @return the value
	 */
	public Value getValue(Fluent fluent);
}

src/edu/uky/cs/nil/sabre/Number.java
public class Number implements Numeric, Value {

	/** Serial version ID */
	private static final long serialVersionUID = Settings.VERSION_UID;

	/** A mapping of Java doubles to their unique corresponding number objects */
	private static final HashMap<java.lang.Double, Number> numbers = new HashMap<>();

	/**
	 * Converts a {@link java.lang.Number Java Number} to a {@link
	 * Value value}, interning it to ensure that there is only ever one number
	 * object with this value. If this method is called multiple times with the
	 * same input value, it will return the same number object every time.
	 *
	 * @param value the value of the number
	 * @return the number object
	 */
	public static final Number get(java.lang.Number value) {
		value = Double.valueOf(value.doubleValue());
		if(value.equals(Double.NaN) || value.equals(-0.0))
			throw Exceptions.notANumber(value);
		Number number = numbers.get(value);
		if(number == null)
			number = new Number((Double) value);
		return number;
	}

	/** A constant representing zero */
	public static final Number ZERO = get(0);

	/** A constant representing one */
	public static final Number ONE = get(1);

	/** A constant representing positive infinity */
	public static final Number POSITIVE_INFINITY = get(Double.POSITIVE_INFINITY);

	/** A constant representing negative infinity */
	public static final Number NEGATIVE_INFINITY = get(Double.NEGATIVE_INFINITY);

	/**
	 * Returns the larger of two numbers.
	 *
	 * @param n1 the first number
	 * @param n2 the second number
	 * @return n2 if it is larger, n1 otherwise
	 */
	public static final Number max(Number n1, Number n2) {
		if(n2.isGreaterThan(n1))
			return n2;
		else
			return n1;
	}

	/**
	 * Returns the smaller of two numbers.
	 *
	 * @param n1 the first number
	 * @param n2 the second number
	 * @return n2 if it is smaller, n1 otherwise
	 */
	public static final Number min(Number n1, Number n2) {
		if(n2.isLessThan(n1))
			return n2;
		else
			return n1;
	}

	/** The value of this number as a Java {@code double} */
	public final java.lang.Double value;

	/**
	 * Constructs a new number.
	 *
	 * @param value the value
	 */
	private Number(java.lang.Double value) {
		this.value = value;
		numbers.put(value, this);
	}

	@Override
	public int hashCode() {
		return value.hashCode();
	}

	@Override
	public String toString() {
		return Utilities.DEFAULT_PRINTER.toString(this);
	}

	@Override
	public int compareTo(Logical other) {
		if(other.equals(False.FALSE) || other.equals(True.TRUE) || other.equals(Unknown.UNKNOWN))
			return 1;
		else if(other instanceof Number)
			return Double.compare(value, ((Number) other).value);
		else
			return -1;
	}

	@Override
	public boolean isGround() {
		return true;
	}

	@Override
	public Number apply(Function<Object, Object> function) {
		return this;
	}

	@Override
	public Number simplify() {
		return this;
	}

	@Override
	public Number evaluate(State state) {
		return this;
	}

	@Override
	public Number prepend(Parameter character) {
		return this;
	}

	/**
	 * Tests whether this number is larger than a given second number.
	 *
	 * @param other the second number
	 * @return true if this number is larger than the second, false otherwise
	 */
	public boolean isGreaterThan(Number other) {
		return compareTo(other) > 0;
	}

	/**
	 * Tests whether this number is larger than or the same as a given second
	 * number.
	 *
	 * @param other the second number
	 * @return true if this number is larger than or the same as the second,
	 * false otherwise
	 */
	public boolean isGreaterThanOrEqualTo(Number other) {
		return isGreaterThan(other) || equals(other);
	}

	/**
	 * Tests whether this number is smaller than a given second number.
	 *
	 * @param other the second number
	 * @return true if this number is smaller than the second, false otherwise
	 */
	public boolean isLessThan(Number other) {
		return compareTo(other) < 0;
	}

	/**
	 * Tests whether this number is smaller than or the same as a given second
	 * number.
	 *
	 * @param other the second number
	 * @return true if this number is smaller than or the same as the second,
	 * false otherwise
	 */
	public boolean isLessThanOrEqualTo(Number other) {
		return isLessThan(other) || equals(other);
	}

	/**
	 * Returns a new number which is the sum of this number and the given
	 * second number.
	 *
	 * @param number the second number
	 * @return the sum of the two numbers
	 */
	public Number add(Number number) {
		if(this.equals(POSITIVE_INFINITY) || number.equals(POSITIVE_INFINITY))
			return POSITIVE_INFINITY;
		else
			return get(value.doubleValue() + number.value.doubleValue());
	}

	/**
	 * Returns a new number which is the difference of this number and the
	 * given second number.
	 *
	 * @param number the second number
	 * @return the difference of the two numbers
	 */
	public Number subtract(Number number) {
		if(this.equals(POSITIVE_INFINITY) || number.equals(NEGATIVE_INFINITY))
			return POSITIVE_INFINITY;
		else if(number.equals(POSITIVE_INFINITY))
			return NEGATIVE_INFINITY;
		else
			return get(value.doubleValue() - number.value.doubleValue());
	}

	/**
	 * Returns a new number which is the product of this number and the given
	 * second number.
	 *
	 * @param number the second number
	 * @return the product of the two numbers
	 */
	public Number multiply(Number number) {
		if(this.equals(ZERO) || number.equals(ZERO))
			return ZERO;
		else
			return get(value.doubleValue() * number.value.doubleValue());
	}

	/**
	 * Returns a new number which is the quotient of this number and the given
	 * second number.
	 *
	 * @param number the second number
	 * @return the quotient of the two numbers
	 */
	public Number divide(Number number) {
		if(number.equals(ZERO))
			throw Exceptions.divideByZero(this);
		else if(this.equals(ZERO) || number.equals(POSITIVE_INFINITY) || number.equals(NEGATIVE_INFINITY))
			return ZERO;
		else
			return get(value.doubleValue() / number.value.doubleValue());
	}

	/**
	 * Ensures there is at most one object for each unique value.
	 *
	 * @return the same object used for all numbers of this value
	 * @throws ObjectStreamException if deserialization failed
	 */
	private Object readResolve() throws ObjectStreamException {
		return get(value);
	}
}

src/edu/uky/cs/nil/sabre/util/Unique.java
public interface Unique {

	@Override
	public int hashCode();
}

src/edu/uky/cs/nil/sabre/Settings.java
public class Settings {

	/** The full name of this software library */
	public static final String TITLE = "The Sabre Narrative Planner";

	/** The list of primary authors */
	public static final String AUTHORS = "Stephen G. Ware";

	/** The major version number comes before the decimal points */
	public static final int MAJOR_VERSION_NUMBER = 0;

	/** The minor version number comes after the decimal point */
	public static final int MINOR_VERSION_NUMBER = 7;

	/** The full version number (major + minor) as a string */
	public static final String VERSION_STRING = MAJOR_VERSION_NUMBER + "." + MINOR_VERSION_NUMBER;

	/**
	 * A long encoding the version number which can be used as a serial version UID
	 */
	public static final long VERSION_UID = java.nio.ByteBuffer.allocate(8).putInt(MAJOR_VERSION_NUMBER).putInt(MINOR_VERSION_NUMBER).getLong(0);

	/** A header including title, authors, and version number */
	public static final String CREDITS = TITLE + " v" + VERSION_STRING + " by " + AUTHORS;

	/** The name of the Boolean type which is pre-defined in all problems */
	public static final String BOOLEAN_TYPE_NAME = "boolean";

	/** The ID number and index of the Boolean type */
	public static final int BOOLEAN_TYPE_ID = 0;

	/** The comment associated with the Boolean type by default */
	public static final String BOOLEAN_TYPE_COMMENT = "";

	/** The name of the number type which is pre-defined in all problems */
	public static final String NUMBER_TYPE_NAME = "number";

	/** The ID number and index of the number type */
	public static final int NUMBER_TYPE_ID = 1;

	/** The comment associated with the number type by default */
	public static final String NUMBER_TYPE_COMMENT = "";

	/**
	 * The name of the entity type which is the parent type of all other types
	 * and is pre-defined in all problems
	 */
	public static final String ENTITY_TYPE_NAME = "entity";

	/** The ID number and index of the entity type */
	public static final int ENTITY_TYPE_ID = 2;

	/** The comment associated with the entity type by default */
	public static final String ENTITY_TYPE_COMMENT = "";

	/**
	 * The name of the character type which represents beings with beliefs and
	 * intentions and is pre-defined in all problems
	 */
	public static final String CHARACTER_TYPE_NAME = "character";

	/** The ID number and index of the character type */
	public static final int CHARACTER_TYPE_ID = 3;

	/** The comment associated with the character type by default */
	public static final String CHARACTER_TYPE_COMMENT = "";

	/** The comment associated with a newly defined type by default */
	public static final String DEFAULT_TYPE_COMMENT = "";

	/** The comment associated with a newly defined entity by default */
	public static final String DEFAULT_ENTITY_COMMENT = "";

	/** The comment associated with a newly defined problem by default */
	public static final String DEFAULT_PROBLEM_COMMENT = "";
}

Answer: return DefaultParser.SUBTRACTION_KEYWORD;

<think>
The code is defining the SUBTRACT operator, mirroring the ADD operator defined earlier. In ADD, the toString method returns DefaultParser.ADDITION_KEYWORD. Therefore, SUBTRACT's toString should return the corresponding subtraction keyword constant. The next line after the method signature is the return statement with DefaultParser.SUBTRACTION_KEYWORD.
</think>
return DefaultParser.SUBTRACTION_KEYWORD;


Input:
import java.io.IOException;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.util.BlockPos;

Context:
src/minecraft/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java
package net.minecraft.network.play.server;

public class S25PacketBlockBreakAnim implements Packet<INetHandlerPlayClient> {
   private int breakerId;
   private BlockPos position;
   private int progress;

   public S25PacketBlockBreakAnim() {
   }

   public S25PacketBlockBreakAnim(int breakerId, BlockPos pos, int progress) {
      this.breakerId = breakerId;
      this.position = pos;
      this.progress = progress;
   }

   @Override
   public void readPacketData(PacketBuffer buf) throws IOException {
      this.breakerId = buf.readVarIntFromBuffer();
      this.position = buf.readBlockPos();
      this.progress = buf.readUnsignedByte();
   }

   @Override
   public void writePacketData(PacketBuffer buf) throws IOException {
      buf.writeVarIntToBuffer(this.breakerId);

src/minecraft/net/minecraft/util/BlockPos.java
public class BlockPos extends Vec3i {
   public static final BlockPos ORIGIN = new BlockPos(0, 0, 0);
   private static final int NUM_X_BITS = 1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000));
   private static final int NUM_Z_BITS = NUM_X_BITS;
   private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS;
   private static final int Y_SHIFT = 0 + NUM_Z_BITS;
   private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS;
   private static final long X_MASK = (1L << NUM_X_BITS) - 1L;
   private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L;
   private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L;

   public BlockPos(int x, int y, int z) {
      super(x, y, z);
   }

   public BlockPos(double x, double y, double z) {
      super(x, y, z);
   }

   public BlockPos(Entity source) {
      this(source.posX, source.posY, source.posZ);
   }

   public BlockPos(Vec3 source) {
      this(source.xCoord, source.yCoord, source.zCoord);
   }

   public BlockPos(Vec3i source) {
      this(source.getX(), source.getY(), source.getZ());
   }

   public boolean equalsBlockPos(BlockPos blockPos) {
      return this.getX() == blockPos.getX() && this.getY() == blockPos.getY() && this.getZ() == blockPos.getZ();
   }

   public boolean equalsBlockPosXZ(BlockPos blockPos) {
      return this.getX() == blockPos.getX() && this.getZ() == blockPos.getZ();
   }

   public BlockPos add(double x, double y, double z) {
      return x == 0.0 && y == 0.0 && z == 0.0 ? this : new BlockPos((double)this.getX() + x, (double)this.getY() + y, (double)this.getZ() + z);
   }

   public BlockPos add(int x, int y, int z) {
      return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z);
   }

   public BlockPos add(Vec3i vec) {
      return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0
         ? this
         : new BlockPos(this.getX() + vec.getX(), this.getY() + vec.getY(), this.getZ() + vec.getZ());
   }

   public BlockPos subtract(Vec3i vec) {
      return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0
         ? this
         : new BlockPos(this.getX() - vec.getX(), this.getY() - vec.getY(), this.getZ() - vec.getZ());
   }

   public BlockPos up() {
      return this.up(1);
   }

   public BlockPos up(int n) {
      return this.offset(EnumFacing.UP, n);
   }

   public BlockPos down() {
      return this.down(1);
   }

   public BlockPos down(int n) {
      return this.offset(EnumFacing.DOWN, n);
   }

   public BlockPos north() {
      return this.north(1);
   }

   public BlockPos north(int n) {
      return this.offset(EnumFacing.NORTH, n);
   }

   public BlockPos south() {
      return this.south(1);
   }

   public BlockPos south(int n) {
      return this.offset(EnumFacing.SOUTH, n);
   }

   public BlockPos west() {
      return this.west(1);
   }

   public BlockPos west(int n) {
      return this.offset(EnumFacing.WEST, n);
   }

   public BlockPos east() {
      return this.east(1);
   }

   public BlockPos east(int n) {
      return this.offset(EnumFacing.EAST, n);
   }

   public BlockPos offset(EnumFacing facing) {
      return this.offset(facing, 1);
   }

   public BlockPos offset(EnumFacing facing, int n) {
      return n == 0
         ? this
         : new BlockPos(this.getX() + facing.getFrontOffsetX() * n, this.getY() + facing.getFrontOffsetY() * n, this.getZ() + facing.getFrontOffsetZ() * n);
   }

   public BlockPos crossProduct(Vec3i vec) {
      return new BlockPos(
         this.getY() * vec.getZ() - this.getZ() * vec.getY(),
         this.getZ() * vec.getX() - this.getX() * vec.getZ(),
         this.getX() * vec.getY() - this.getY() * vec.getX()
      );
   }

   public long toLong() {
      return ((long)this.getX() & X_MASK) << X_SHIFT | ((long)this.getY() & Y_MASK) << Y_SHIFT | ((long)this.getZ() & Z_MASK) << 0;
   }

   public static BlockPos fromLong(long serialized) {
      int i = (int)(serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS);
      int j = (int)(serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS);
      int k = (int)(serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS);
      return new BlockPos(i, j, k);
   }

   public static Iterable<BlockPos> getAllInBox(BlockPos from, BlockPos to) {
      final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
      final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
      return new Iterable<BlockPos>() {
         @Override
         public Iterator<BlockPos> iterator() {
            return new AbstractIterator<BlockPos>() {
               private BlockPos lastReturned = null;

               protected BlockPos computeNext() {
                  if (this.lastReturned == null) {
                     this.lastReturned = blockpos;
                     return this.lastReturned;
                  } else if (this.lastReturned.equals(blockpos1)) {
                     return this.endOfData();
                  } else {
                     int i = this.lastReturned.getX();
                     int j = this.lastReturned.getY();
                     int k = this.lastReturned.getZ();
                     if (i < blockpos1.getX()) {
                        ++i;
                     } else if (j < blockpos1.getY()) {
                        i = blockpos.getX();
                        ++j;
                     } else if (k < blockpos1.getZ()) {
                        i = blockpos.getX();
                        j = blockpos.getY();
                        ++k;
                     }

                     this.lastReturned = new BlockPos(i, j, k);
                     return this.lastReturned;
                  }
               }
            };
         }
      };
   }

   public static Iterable<BlockPos.MutableBlockPos> getAllInBoxMutable(BlockPos from, BlockPos to) {
      final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
      final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
      return new Iterable<BlockPos.MutableBlockPos>() {
         @Override
         public Iterator<BlockPos.MutableBlockPos> iterator() {
            return new AbstractIterator<BlockPos.MutableBlockPos>() {
               private BlockPos.MutableBlockPos theBlockPos = null;

               protected BlockPos.MutableBlockPos computeNext() {
                  if (this.theBlockPos == null) {
                     this.theBlockPos = new BlockPos.MutableBlockPos(blockpos.getX(), blockpos.getY(), blockpos.getZ());
                     return this.theBlockPos;
                  } else if (this.theBlockPos.equals(blockpos1)) {
                     return this.endOfData();
                  } else {
                     int i = this.theBlockPos.getX();
                     int j = this.theBlockPos.getY();
                     int k = this.theBlockPos.getZ();
                     if (i < blockpos1.getX()) {
                        ++i;
                     } else if (j < blockpos1.getY()) {
                        i = blockpos.getX();
                        ++j;
                     } else if (k < blockpos1.getZ()) {
                        i = blockpos.getX();
                        j = blockpos.getY();
                        ++k;
                     }

                     this.theBlockPos.x = i;
                     this.theBlockPos.y = j;
                     this.theBlockPos.z = k;
                     return this.theBlockPos;
                  }
               }
            };
         }
      };
   }

    public static final class MutableBlockPos extends BlockPos {
      private int x;
      private int y;
      private int z;

      public MutableBlockPos() {
         this(0, 0, 0);
      }

      public MutableBlockPos(int x_, int y_, int z_) {
         super(0, 0, 0);
         this.x = x_;
         this.y = y_;
         this.z = z_;
      }

      @Override
      public int getX() {
         return this.x;
      }

      @Override
      public int getY() {
         return this.y;
      }

      @Override
      public int getZ() {
         return this.z;
      }

      public BlockPos.MutableBlockPos func_181079_c(int p_181079_1_, int p_181079_2_, int p_181079_3_) {
         this.x = p_181079_1_;
         this.y = p_181079_2_;
         this.z = p_181079_3_;
         return this;
      }
   }
}

src/minecraft/net/minecraft/network/PacketBuffer.java
public class PacketBuffer extends ByteBuf {
   private final ByteBuf buf;

   public PacketBuffer(ByteBuf wrapped) {
      this.buf = wrapped;
   }

   public static int getVarIntSize(int input) {
      for(int i = 1; i < 5; ++i) {
         if ((input & -1 << i * 7) == 0) {
            return i;
         }
      }

      return 5;
   }

   public void writeByteArray(byte[] array) {
      this.writeVarIntToBuffer(array.length);
      this.writeBytes(array);
   }

   public byte[] readByteArray() {
      byte[] abyte = new byte[this.readVarIntFromBuffer()];
      this.readBytes(abyte);
      return abyte;
   }

   public BlockPos readBlockPos() {
      return BlockPos.fromLong(this.readLong());
   }

   public void writeBlockPos(BlockPos pos) {
      this.writeLong(pos.toLong());
   }

   public IChatComponent readChatComponent() throws IOException {
      return IChatComponent.Serializer.jsonToComponent(this.readStringFromBuffer(32767));
   }

   public void writeChatComponent(IChatComponent component) throws IOException {
      this.writeString(IChatComponent.Serializer.componentToJson(component));
   }

   public <T extends Enum<T>> T readEnumValue(Class<T> enumClass) {
      return enumClass.getEnumConstants()[this.readVarIntFromBuffer()];
   }

   public void writeEnumValue(Enum<?> value) {
      this.writeVarIntToBuffer(value.ordinal());
   }

   public int readVarIntFromBuffer() {
      int i = 0;
      int j = 0;

      byte b0;
      do {
         b0 = this.readByte();
         i |= (b0 & 127) << j++ * 7;
         if (j > 5) {
            throw new RuntimeException("VarInt too big");
         }
      } while((b0 & 128) == 128);

      return i;
   }

   public long readVarLong() {
      long i = 0L;
      int j = 0;

      byte b0;
      do {
         b0 = this.readByte();
         i |= (long)(b0 & 127) << j++ * 7;
         if (j > 10) {
            throw new RuntimeException("VarLong too big");
         }
      } while((b0 & 128) == 128);

      return i;
   }

   public void writeUuid(UUID uuid) {
      this.writeLong(uuid.getMostSignificantBits());
      this.writeLong(uuid.getLeastSignificantBits());
   }

   public UUID readUuid() {
      return new UUID(this.readLong(), this.readLong());
   }

   public void writeVarIntToBuffer(int input) {
      while((input & -128) != 0) {
         this.writeByte(input & 127 | 128);
         input >>>= 7;
      }

      this.writeByte(input);
   }

   public void writeVarLong(long value) {
      while((value & -128L) != 0L) {
         this.writeByte((int)(value & 127L) | 128);
         value >>>= 7;
      }

      this.writeByte((int)value);
   }

   public void writeNBTTagCompoundToBuffer(NBTTagCompound nbt) {
      if (nbt == null) {
         this.writeByte(0);
      } else {
         try {
            CompressedStreamTools.write(nbt, new ByteBufOutputStream(this));
         } catch (IOException var3) {
            throw new EncoderException(var3);
         }
      }
   }

   public NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException {
      int i = this.readerIndex();
      byte b0 = this.readByte();
      if (b0 == 0) {
         return null;
      } else {
         this.readerIndex(i);
         return CompressedStreamTools.read(new ByteBufInputStream(this), new NBTSizeTracker(2097152L));
      }
   }

   public void writeItemStackToBuffer(ItemStack stack) {
      if (stack == null) {
         this.writeShort(-1);
      } else {
         this.writeShort(Item.getIdFromItem(stack.getItem()));
         this.writeByte(stack.stackSize);
         this.writeShort(stack.getMetadata());
         NBTTagCompound nbttagcompound = null;
         if (stack.getItem().isDamageable() || stack.getItem().getShareTag()) {
            nbttagcompound = stack.getTagCompound();
         }

         this.writeNBTTagCompoundToBuffer(nbttagcompound);
      }
   }

   public ItemStack readItemStackFromBuffer() throws IOException {
      ItemStack itemstack = null;
      int i = this.readShort();
      if (i >= 0) {
         int j = this.readByte();
         int k = this.readShort();
         itemstack = new ItemStack(Item.getItemById(i), j, k);
         itemstack.setTagCompound(this.readNBTTagCompoundFromBuffer());
      }

      return itemstack;
   }

   public String readStringFromBuffer(int maxLength) {
      int i = this.readVarIntFromBuffer();
      if (i > maxLength * 4) {
         throw new DecoderException("The received encoded string buffer length is longer than maximum allowed (" + i + " > " + maxLength * 4 + ")");
      } else if (i < 0) {
         throw new DecoderException("The received encoded string buffer length is less than zero! Weird string!");
      } else {
         String s = new String(this.readBytes(i).array(), Charsets.UTF_8);
         if (s.length() > maxLength) {
            throw new DecoderException("The received string length is longer than maximum allowed (" + i + " > " + maxLength + ")");
         } else {
            return s;
         }
      }
   }

   public PacketBuffer writeString(String string) {
      byte[] abyte = string.getBytes(Charsets.UTF_8);
      if (abyte.length > 32767) {
         throw new EncoderException("String too big (was " + string.length() + " bytes encoded, max " + 32767 + ")");
      } else {
         this.writeVarIntToBuffer(abyte.length);
         this.writeBytes(abyte);
         return this;
      }
   }

   @Override
   public int capacity() {
      return this.buf.capacity();
   }

   @Override
   public ByteBuf capacity(int p_capacity_1_) {
      return this.buf.capacity(p_capacity_1_);
   }

   @Override
   public int maxCapacity() {
      return this.buf.maxCapacity();
   }

   @Override
   public ByteBufAllocator alloc() {
      return this.buf.alloc();
   }

   @Override
   public ByteOrder order() {
      return this.buf.order();
   }

   @Override
   public ByteBuf order(ByteOrder p_order_1_) {
      return this.buf.order(p_order_1_);
   }

   @Override
   public ByteBuf unwrap() {
      return this.buf.unwrap();
   }

   @Override
   public boolean isDirect() {
      return this.buf.isDirect();
   }

   @Override
   public int readerIndex() {
      return this.buf.readerIndex();
   }

   @Override
   public ByteBuf readerIndex(int p_readerIndex_1_) {
      return this.buf.readerIndex(p_readerIndex_1_);
   }

   @Override
   public int writerIndex() {
      return this.buf.writerIndex();
   }

   @Override
   public ByteBuf writerIndex(int p_writerIndex_1_) {
      return this.buf.writerIndex(p_writerIndex_1_);
   }

   @Override
   public ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_) {
      return this.buf.setIndex(p_setIndex_1_, p_setIndex_2_);
   }

   @Override
   public int readableBytes() {
      return this.buf.readableBytes();
   }

   @Override
   public int writableBytes() {
      return this.buf.writableBytes();
   }

   @Override
   public int maxWritableBytes() {
      return this.buf.maxWritableBytes();
   }

   @Override
   public boolean isReadable() {
      return this.buf.isReadable();
   }

   @Override
   public boolean isReadable(int p_isReadable_1_) {
      return this.buf.isReadable(p_isReadable_1_);
   }

   @Override
   public boolean isWritable() {
      return this.buf.isWritable();
   }

   @Override
   public boolean isWritable(int p_isWritable_1_) {
      return this.buf.isWritable(p_isWritable_1_);
   }

   @Override
   public ByteBuf clear() {
      return this.buf.clear();
   }

   @Override
   public ByteBuf markReaderIndex() {
      return this.buf.markReaderIndex();
   }

   @Override
   public ByteBuf resetReaderIndex() {
      return this.buf.resetReaderIndex();
   }

   @Override
   public ByteBuf markWriterIndex() {
      return this.buf.markWriterIndex();
   }

   @Override
   public ByteBuf resetWriterIndex() {
      return this.buf.resetWriterIndex();
   }

   @Override
   public ByteBuf discardReadBytes() {
      return this.buf.discardReadBytes();
   }

   @Override
   public ByteBuf discardSomeReadBytes() {
      return this.buf.discardSomeReadBytes();
   }

   @Override
   public ByteBuf ensureWritable(int p_ensureWritable_1_) {
      return this.buf.ensureWritable(p_ensureWritable_1_);
   }

   @Override
   public int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_) {
      return this.buf.ensureWritable(p_ensureWritable_1_, p_ensureWritable_2_);
   }

   @Override
   public boolean getBoolean(int p_getBoolean_1_) {
      return this.buf.getBoolean(p_getBoolean_1_);
   }

   @Override
   public byte getByte(int p_getByte_1_) {
      return this.buf.getByte(p_getByte_1_);
   }

   @Override
   public short getUnsignedByte(int p_getUnsignedByte_1_) {
      return this.buf.getUnsignedByte(p_getUnsignedByte_1_);
   }

   @Override
   public short getShort(int p_getShort_1_) {
      return this.buf.getShort(p_getShort_1_);
   }

   @Override
   public int getUnsignedShort(int p_getUnsignedShort_1_) {
      return this.buf.getUnsignedShort(p_getUnsignedShort_1_);
   }

   @Override
   public int getMedium(int p_getMedium_1_) {
      return this.buf.getMedium(p_getMedium_1_);
   }

   @Override
   public int getUnsignedMedium(int p_getUnsignedMedium_1_) {
      return this.buf.getUnsignedMedium(p_getUnsignedMedium_1_);
   }

   @Override
   public int getInt(int p_getInt_1_) {
      return this.buf.getInt(p_getInt_1_);
   }

   @Override
   public long getUnsignedInt(int p_getUnsignedInt_1_) {
      return this.buf.getUnsignedInt(p_getUnsignedInt_1_);
   }

   @Override
   public long getLong(int p_getLong_1_) {
      return this.buf.getLong(p_getLong_1_);
   }

   @Override
   public char getChar(int p_getChar_1_) {
      return this.buf.getChar(p_getChar_1_);
   }

   @Override
   public float getFloat(int p_getFloat_1_) {
      return this.buf.getFloat(p_getFloat_1_);
   }

   @Override
   public double getDouble(int p_getDouble_1_) {
      return this.buf.getDouble(p_getDouble_1_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_) {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_) {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_) {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_) {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
   }

   @Override
   public ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_) throws IOException {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
   }

   @Override
   public int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_) throws IOException {
      return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
   }

   @Override
   public ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_) {
      return this.buf.setBoolean(p_setBoolean_1_, p_setBoolean_2_);
   }

   @Override
   public ByteBuf setByte(int p_setByte_1_, int p_setByte_2_) {
      return this.buf.setByte(p_setByte_1_, p_setByte_2_);
   }

   @Override
   public ByteBuf setShort(int p_setShort_1_, int p_setShort_2_) {
      return this.buf.setShort(p_setShort_1_, p_setShort_2_);
   }

   @Override
   public ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_) {
      return this.buf.setMedium(p_setMedium_1_, p_setMedium_2_);
   }

   @Override
   public ByteBuf setInt(int p_setInt_1_, int p_setInt_2_) {
      return this.buf.setInt(p_setInt_1_, p_setInt_2_);
   }

   @Override
   public ByteBuf setLong(int p_setLong_1_, long p_setLong_2_) {
      return this.buf.setLong(p_setLong_1_, p_setLong_2_);
   }

   @Override
   public ByteBuf setChar(int p_setChar_1_, int p_setChar_2_) {
      return this.buf.setChar(p_setChar_1_, p_setChar_2_);
   }

   @Override
   public ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_) {
      return this.buf.setFloat(p_setFloat_1_, p_setFloat_2_);
   }

   @Override
   public ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_) {
      return this.buf.setDouble(p_setDouble_1_, p_setDouble_2_);
   }

   @Override
   public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_) {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
   }

   @Override
   public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_) {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
   }

   @Override
   public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_);
   }

   @Override
   public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_) {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
   }

   @Override
   public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_);
   }

   @Override
   public ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_) {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
   }

   @Override
   public int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_) throws IOException {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
   }

   @Override
   public int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_) throws IOException {
      return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
   }

   @Override
   public ByteBuf setZero(int p_setZero_1_, int p_setZero_2_) {
      return this.buf.setZero(p_setZero_1_, p_setZero_2_);
   }

   @Override
   public boolean readBoolean() {
      return this.buf.readBoolean();
   }

   @Override
   public byte readByte() {
      return this.buf.readByte();
   }

   @Override
   public short readUnsignedByte() {
      return this.buf.readUnsignedByte();
   }

   @Override
   public short readShort() {
      return this.buf.readShort();
   }

   @Override
   public int readUnsignedShort() {
      return this.buf.readUnsignedShort();
   }

   @Override
   public int readMedium() {
      return this.buf.readMedium();
   }

   @Override
   public int readUnsignedMedium() {
      return this.buf.readUnsignedMedium();
   }

   @Override
   public int readInt() {
      return this.buf.readInt();
   }

   @Override
   public long readUnsignedInt() {
      return this.buf.readUnsignedInt();
   }

   @Override
   public long readLong() {
      return this.buf.readLong();
   }

   @Override
   public char readChar() {
      return this.buf.readChar();
   }

   @Override
   public float readFloat() {
      return this.buf.readFloat();
   }

   @Override
   public double readDouble() {
      return this.buf.readDouble();
   }

   @Override
   public ByteBuf readBytes(int p_readBytes_1_) {
      return this.buf.readBytes(p_readBytes_1_);
   }

   @Override
   public ByteBuf readSlice(int p_readSlice_1_) {
      return this.buf.readSlice(p_readSlice_1_);
   }

   @Override
   public ByteBuf readBytes(ByteBuf p_readBytes_1_) {
      return this.buf.readBytes(p_readBytes_1_);
   }

   @Override
   public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_) {
      return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
   }

   @Override
   public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) {
      return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_);
   }

   @Override
   public ByteBuf readBytes(byte[] p_readBytes_1_) {
      return this.buf.readBytes(p_readBytes_1_);
   }

   @Override
   public ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) {
      return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_);
   }

   @Override
   public ByteBuf readBytes(ByteBuffer p_readBytes_1_) {
      return this.buf.readBytes(p_readBytes_1_);
   }

   @Override
   public ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_) throws IOException {
      return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
   }

   @Override
   public int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_) throws IOException {
      return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
   }

   @Override
   public ByteBuf skipBytes(int p_skipBytes_1_) {
      return this.buf.skipBytes(p_skipBytes_1_);
   }

   @Override
   public ByteBuf writeBoolean(boolean p_writeBoolean_1_) {
      return this.buf.writeBoolean(p_writeBoolean_1_);
   }

   @Override
   public ByteBuf writeByte(int p_writeByte_1_) {
      return this.buf.writeByte(p_writeByte_1_);
   }

   @Override
   public ByteBuf writeShort(int p_writeShort_1_) {
      return this.buf.writeShort(p_writeShort_1_);
   }

   @Override
   public ByteBuf writeMedium(int p_writeMedium_1_) {
      return this.buf.writeMedium(p_writeMedium_1_);
   }

   @Override
   public ByteBuf writeInt(int p_writeInt_1_) {
      return this.buf.writeInt(p_writeInt_1_);
   }

   @Override
   public ByteBuf writeLong(long p_writeLong_1_) {
      return this.buf.writeLong(p_writeLong_1_);
   }

   @Override
   public ByteBuf writeChar(int p_writeChar_1_) {
      return this.buf.writeChar(p_writeChar_1_);
   }

   @Override
   public ByteBuf writeFloat(float p_writeFloat_1_) {
      return this.buf.writeFloat(p_writeFloat_1_);
   }

   @Override
   public ByteBuf writeDouble(double p_writeDouble_1_) {
      return this.buf.writeDouble(p_writeDouble_1_);
   }

   @Override
   public ByteBuf writeBytes(ByteBuf p_writeBytes_1_) {
      return this.buf.writeBytes(p_writeBytes_1_);
   }

   @Override
   public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_) {
      return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
   }

   @Override
   public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) {
      return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_);
   }

   @Override
   public ByteBuf writeBytes(byte[] p_writeBytes_1_) {
      return this.buf.writeBytes(p_writeBytes_1_);
   }

   @Override
   public ByteBuf writeBytes(byte[] p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) {
      return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_);
   }

   @Override
   public ByteBuf writeBytes(ByteBuffer p_writeBytes_1_) {
      return this.buf.writeBytes(p_writeBytes_1_);
   }

   @Override
   public int writeBytes(InputStream p_writeBytes_1_, int p_writeBytes_2_) throws IOException {
      return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
   }

   @Override
   public int writeBytes(ScatteringByteChannel p_writeBytes_1_, int p_writeBytes_2_) throws IOException {
      return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
   }

   @Override
   public ByteBuf writeZero(int p_writeZero_1_) {
      return this.buf.writeZero(p_writeZero_1_);
   }

   @Override
   public int indexOf(int p_indexOf_1_, int p_indexOf_2_, byte p_indexOf_3_) {
      return this.buf.indexOf(p_indexOf_1_, p_indexOf_2_, p_indexOf_3_);
   }

   @Override
   public int bytesBefore(byte p_bytesBefore_1_) {
      return this.buf.bytesBefore(p_bytesBefore_1_);
   }

   @Override
   public int bytesBefore(int p_bytesBefore_1_, byte p_bytesBefore_2_) {
      return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_);
   }

   @Override
   public int bytesBefore(int p_bytesBefore_1_, int p_bytesBefore_2_, byte p_bytesBefore_3_) {
      return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_, p_bytesBefore_3_);
   }

   @Override
   public int forEachByte(ByteBufProcessor p_forEachByte_1_) {
      return this.buf.forEachByte(p_forEachByte_1_);
   }

   @Override
   public int forEachByte(int p_forEachByte_1_, int p_forEachByte_2_, ByteBufProcessor p_forEachByte_3_) {
      return this.buf.forEachByte(p_forEachByte_1_, p_forEachByte_2_, p_forEachByte_3_);
   }

   @Override
   public int forEachByteDesc(ByteBufProcessor p_forEachByteDesc_1_) {
      return this.buf.forEachByteDesc(p_forEachByteDesc_1_);
   }

   @Override
   public int forEachByteDesc(int p_forEachByteDesc_1_, int p_forEachByteDesc_2_, ByteBufProcessor p_forEachByteDesc_3_) {
      return this.buf.forEachByteDesc(p_forEachByteDesc_1_, p_forEachByteDesc_2_, p_forEachByteDesc_3_);
   }

   @Override
   public ByteBuf copy() {
      return this.buf.copy();
   }

   @Override
   public ByteBuf copy(int p_copy_1_, int p_copy_2_) {
      return this.buf.copy(p_copy_1_, p_copy_2_);
   }

   @Override
   public ByteBuf slice() {
      return this.buf.slice();
   }

   @Override
   public ByteBuf slice(int p_slice_1_, int p_slice_2_) {
      return this.buf.slice(p_slice_1_, p_slice_2_);
   }

   @Override
   public ByteBuf duplicate() {
      return this.buf.duplicate();
   }

   @Override
   public int nioBufferCount() {
      return this.buf.nioBufferCount();
   }

   @Override
   public ByteBuffer nioBuffer() {
      return this.buf.nioBuffer();
   }

   @Override
   public ByteBuffer nioBuffer(int p_nioBuffer_1_, int p_nioBuffer_2_) {
      return this.buf.nioBuffer(p_nioBuffer_1_, p_nioBuffer_2_);
   }

   @Override
   public ByteBuffer internalNioBuffer(int p_internalNioBuffer_1_, int p_internalNioBuffer_2_) {
      return this.buf.internalNioBuffer(p_internalNioBuffer_1_, p_internalNioBuffer_2_);
   }

   @Override
   public ByteBuffer[] nioBuffers() {
      return this.buf.nioBuffers();
   }

   @Override
   public ByteBuffer[] nioBuffers(int p_nioBuffers_1_, int p_nioBuffers_2_) {
      return this.buf.nioBuffers(p_nioBuffers_1_, p_nioBuffers_2_);
   }

   @Override
   public boolean hasArray() {
      return this.buf.hasArray();
   }

   @Override
   public byte[] array() {
      return this.buf.array();
   }

   @Override
   public int arrayOffset() {
      return this.buf.arrayOffset();
   }

   @Override
   public boolean hasMemoryAddress() {
      return this.buf.hasMemoryAddress();
   }

   @Override
   public long memoryAddress() {
      return this.buf.memoryAddress();
   }

   @Override
   public String toString(Charset p_toString_1_) {
      return this.buf.toString(p_toString_1_);
   }

   @Override
   public String toString(int p_toString_1_, int p_toString_2_, Charset p_toString_3_) {
      return this.buf.toString(p_toString_1_, p_toString_2_, p_toString_3_);
   }

   @Override
   public int hashCode() {
      return this.buf.hashCode();
   }

   @Override
   public boolean equals(Object p_equals_1_) {
      return this.buf.equals(p_equals_1_);
   }

   @Override
   public int compareTo(ByteBuf p_compareTo_1_) {
      return this.buf.compareTo(p_compareTo_1_);
   }

   @Override
   public String toString() {
      return this.buf.toString();
   }

   @Override
   public ByteBuf retain(int p_retain_1_) {
      return this.buf.retain(p_retain_1_);
   }

   @Override
   public ByteBuf retain() {
      return this.buf.retain();
   }

   @Override
   public int refCnt() {
      return this.buf.refCnt();
   }

   @Override
   public boolean release() {
      return this.buf.release();
   }

   @Override
   public boolean release(int p_release_1_) {
      return this.buf.release(p_release_1_);
   }
}

Answer: buf.writeBlockPos(this.position);

<think>
In the writePacketData method, the packet fields must be written in the same order they are read. The read method reads breakerId, then position, then progress. After writing the breakerId with writeVarIntToBuffer, the next field to write is the BlockPos, using the PacketBuffer method writeBlockPos. Therefore the next line is buf.writeBlockPos(this.position);
</think>
buf.writeBlockPos(this.position);


Input:
import java.io.IOException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;

Context:
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTree.java
/*
 * Copyright (C) 2009, Google Inc.
 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.eclipse.jgit.revwalk;

/**
 * A reference to a tree of subtrees/files.
 */
public class RevTree extends RevObject {
	/**
	 * Create a new tree reference.
	 *
	 * @param id
	 *            object name for the tree.
	 */
	protected RevTree(AnyObjectId id) {
		super(id);
	}

	@Override

org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
public abstract class AnyObjectId implements Comparable<AnyObjectId> {

	/**
	 * Compare two object identifier byte sequences for equality.
	 *
	 * @param firstObjectId
	 *            the first identifier to compare. Must not be null.
	 * @param secondObjectId
	 *            the second identifier to compare. Must not be null.
	 * @return true if the two identifiers are the same.
	 * @deprecated use {@link #isEqual(AnyObjectId, AnyObjectId)} instead
	 */
	@Deprecated
	@SuppressWarnings("AmbiguousMethodReference")
	public static boolean equals(final AnyObjectId firstObjectId,
			final AnyObjectId secondObjectId) {
		return isEqual(firstObjectId, secondObjectId);
	}

	/**
	 * Compare two object identifier byte sequences for equality.
	 *
	 * @param firstObjectId
	 *            the first identifier to compare. Must not be null.
	 * @param secondObjectId
	 *            the second identifier to compare. Must not be null.
	 * @return true if the two identifiers are the same.
	 * @since 5.4
	 */
	public static boolean isEqual(final AnyObjectId firstObjectId,
			final AnyObjectId secondObjectId) {
		if (References.isSameObject(firstObjectId, secondObjectId)) {
			return true;
		}
		// We test word 3 first since the git file-based ODB
		// uses the first byte of w1, and we use w2 as the
		// hash code, one of those probably came up with these
		// two instances which we are comparing for equality.
		// Therefore the first two words are very likely to be
		// identical. We want to break away from collisions as
		// quickly as possible.
		return firstObjectId.w3 == secondObjectId.w3
				&& firstObjectId.w4 == secondObjectId.w4
				&& firstObjectId.w5 == secondObjectId.w5
				&& firstObjectId.w1 == secondObjectId.w1
				&& firstObjectId.w2 == secondObjectId.w2;
	}

	int w1;

	int w2;

	int w3;

	int w4;

	int w5;

	/**
	 * Get the first 8 bits of the ObjectId.
	 *
	 * This is a faster version of {@code getByte(0)}.
	 *
	 * @return a discriminator usable for a fan-out style map. Returned values
	 *         are unsigned and thus are in the range [0,255] rather than the
	 *         signed byte range of [-128, 127].
	 */
	public final int getFirstByte() {
		return w1 >>> 24;
	}

	/**
	 * Get any byte from the ObjectId.
	 *
	 * Callers hard-coding {@code getByte(0)} should instead use the much faster
	 * special case variant {@link #getFirstByte()}.
	 *
	 * @param index
	 *            index of the byte to obtain from the raw form of the ObjectId.
	 *            Must be in range [0,
	 *            {@link org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH}).
	 * @return the value of the requested byte at {@code index}. Returned values
	 *         are unsigned and thus are in the range [0,255] rather than the
	 *         signed byte range of [-128, 127].
	 * @throws java.lang.ArrayIndexOutOfBoundsException
	 *             {@code index} is less than 0, equal to
	 *             {@link org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH}, or
	 *             greater than
	 *             {@link org.eclipse.jgit.lib.Constants#OBJECT_ID_LENGTH}.
	 */
	public final int getByte(int index) {
		int w;
		switch (index >> 2) {
		case 0:
			w = w1;
			break;
		case 1:
			w = w2;
			break;
		case 2:
			w = w3;
			break;
		case 3:
			w = w4;
			break;
		case 4:
			w = w5;
			break;
		default:
			throw new ArrayIndexOutOfBoundsException(index);
		}

		return (w >>> (8 * (3 - (index & 3)))) & 0xff;
	}

	/**
	 * {@inheritDoc}
	 *

	 * Compare this ObjectId to another and obtain a sort ordering.
	 */
	@Override
	public final int compareTo(AnyObjectId other) {
		if (this == other)
			return 0;

		int cmp;

		cmp = NB.compareUInt32(w1, other.w1);
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w2, other.w2);
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w3, other.w3);
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w4, other.w4);
		if (cmp != 0)
			return cmp;

		return NB.compareUInt32(w5, other.w5);
	}

	/**
	 * Compare this ObjectId to a network-byte-order ObjectId.
	 *
	 * @param bs
	 *            array containing the other ObjectId in network byte order.
	 * @param p
	 *            position within {@code bs} to start the compare at. At least
	 *            20 bytes, starting at this position are required.
	 * @return a negative integer, zero, or a positive integer as this object is
	 *         less than, equal to, or greater than the specified object.
	 */
	public final int compareTo(byte[] bs, int p) {
		int cmp;

		cmp = NB.compareUInt32(w1, NB.decodeInt32(bs, p));
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w2, NB.decodeInt32(bs, p + 4));
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w3, NB.decodeInt32(bs, p + 8));
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w4, NB.decodeInt32(bs, p + 12));
		if (cmp != 0)
			return cmp;

		return NB.compareUInt32(w5, NB.decodeInt32(bs, p + 16));
	}

	/**
	 * Compare this ObjectId to a network-byte-order ObjectId.
	 *
	 * @param bs
	 *            array containing the other ObjectId in network byte order.
	 * @param p
	 *            position within {@code bs} to start the compare at. At least 5
	 *            integers, starting at this position are required.
	 * @return a negative integer, zero, or a positive integer as this object is
	 *         less than, equal to, or greater than the specified object.
	 */
	public final int compareTo(int[] bs, int p) {
		int cmp;

		cmp = NB.compareUInt32(w1, bs[p]);
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w2, bs[p + 1]);
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w3, bs[p + 2]);
		if (cmp != 0)
			return cmp;

		cmp = NB.compareUInt32(w4, bs[p + 3]);
		if (cmp != 0)
			return cmp;

		return NB.compareUInt32(w5, bs[p + 4]);
	}

	/**
	 * Tests if this ObjectId starts with the given abbreviation.
	 *
	 * @param abbr
	 *            the abbreviation.
	 * @return true if this ObjectId begins with the abbreviation; else false.
	 */
	public boolean startsWith(AbbreviatedObjectId abbr) {
		return abbr.prefixCompare(this) == 0;
	}

	@Override
	public final int hashCode() {
		return w2;
	}

	/**
	 * Determine if this ObjectId has exactly the same value as another.
	 *
	 * @param other
	 *            the other id to compare to. May be null.
	 * @return true only if both ObjectIds have identical bits.
	 */
	@SuppressWarnings({ "NonOverridingEquals", "AmbiguousMethodReference" })
	public final boolean equals(AnyObjectId other) {
		return other != null ? isEqual(this, other) : false;
	}

	@Override
	public final boolean equals(Object o) {
		if (o instanceof AnyObjectId) {
			return equals((AnyObjectId) o);
		}
		return false;
	}

	/**
	 * Copy this ObjectId to an output writer in raw binary.
	 *
	 * @param w
	 *            the buffer to copy to. Must be in big endian order.
	 */
	public void copyRawTo(ByteBuffer w) {
		w.putInt(w1);
		w.putInt(w2);
		w.putInt(w3);
		w.putInt(w4);
		w.putInt(w5);
	}

	/**
	 * Copy this ObjectId to a byte array.
	 *
	 * @param b
	 *            the buffer to copy to.
	 * @param o
	 *            the offset within b to write at.
	 */
	public void copyRawTo(byte[] b, int o) {
		NB.encodeInt32(b, o, w1);
		NB.encodeInt32(b, o + 4, w2);
		NB.encodeInt32(b, o + 8, w3);
		NB.encodeInt32(b, o + 12, w4);
		NB.encodeInt32(b, o + 16, w5);
	}

	/**
	 * Copy this ObjectId to an int array.
	 *
	 * @param b
	 *            the buffer to copy to.
	 * @param o
	 *            the offset within b to write at.
	 */
	public void copyRawTo(int[] b, int o) {
		b[o] = w1;
		b[o + 1] = w2;
		b[o + 2] = w3;
		b[o + 3] = w4;
		b[o + 4] = w5;
	}

	/**
	 * Copy this ObjectId to an output writer in raw binary.
	 *
	 * @param w
	 *            the stream to write to.
	 * @throws java.io.IOException
	 *             the stream writing failed.
	 */
	public void copyRawTo(OutputStream w) throws IOException {
		writeRawInt(w, w1);
		writeRawInt(w, w2);
		writeRawInt(w, w3);
		writeRawInt(w, w4);
		writeRawInt(w, w5);
	}

	private static void writeRawInt(OutputStream w, int v)
			throws IOException {
		w.write(v >>> 24);
		w.write(v >>> 16);
		w.write(v >>> 8);
		w.write(v);
	}

	/**
	 * Copy this ObjectId to an output writer in hex format.
	 *
	 * @param w
	 *            the stream to copy to.
	 * @throws java.io.IOException
	 *             the stream writing failed.
	 */
	public void copyTo(OutputStream w) throws IOException {
		w.write(toHexByteArray());
	}

	/**
	 * Copy this ObjectId to a byte array in hex format.
	 *
	 * @param b
	 *            the buffer to copy to.
	 * @param o
	 *            the offset within b to write at.
	 */
	public void copyTo(byte[] b, int o) {
		formatHexByte(b, o + 0, w1);
		formatHexByte(b, o + 8, w2);
		formatHexByte(b, o + 16, w3);
		formatHexByte(b, o + 24, w4);
		formatHexByte(b, o + 32, w5);
	}

	/**
	 * Copy this ObjectId to a ByteBuffer in hex format.
	 *
	 * @param b
	 *            the buffer to copy to.
	 */
	public void copyTo(ByteBuffer b) {
		b.put(toHexByteArray());
	}

	private byte[] toHexByteArray() {
		final byte[] dst = new byte[Constants.OBJECT_ID_STRING_LENGTH];
		formatHexByte(dst, 0, w1);
		formatHexByte(dst, 8, w2);
		formatHexByte(dst, 16, w3);
		formatHexByte(dst, 24, w4);
		formatHexByte(dst, 32, w5);
		return dst;
	}

	private static final byte[] hexbyte = { '0', '1', '2', '3', '4', '5', '6',
			'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };

	private static void formatHexByte(byte[] dst, int p, int w) {
		int o = p + 7;
		while (o >= p && w != 0) {
			dst[o--] = hexbyte[w & 0xf];
			w >>>= 4;
		}
		while (o >= p)
			dst[o--] = '0';
	}

	/**
	 * Copy this ObjectId to an output writer in hex format.
	 *
	 * @param w
	 *            the stream to copy to.
	 * @throws java.io.IOException
	 *             the stream writing failed.
	 */
	public void copyTo(Writer w) throws IOException {
		w.write(toHexCharArray());
	}

	/**
	 * Copy this ObjectId to an output writer in hex format.
	 *
	 * @param tmp
	 *            temporary char array to buffer construct into before writing.
	 *            Must be at least large enough to hold 2 digits for each byte
	 *            of object id (40 characters or larger).
	 * @param w
	 *            the stream to copy to.
	 * @throws java.io.IOException
	 *             the stream writing failed.
	 */
	public void copyTo(char[] tmp, Writer w) throws IOException {
		toHexCharArray(tmp);
		w.write(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);
	}

	/**
	 * Copy this ObjectId to a StringBuilder in hex format.
	 *
	 * @param tmp
	 *            temporary char array to buffer construct into before writing.
	 *            Must be at least large enough to hold 2 digits for each byte
	 *            of object id (40 characters or larger).
	 * @param w
	 *            the string to append onto.
	 */
	public void copyTo(char[] tmp, StringBuilder w) {
		toHexCharArray(tmp);
		w.append(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);
	}

	private char[] toHexCharArray() {
		final char[] dst = new char[Constants.OBJECT_ID_STRING_LENGTH];
		toHexCharArray(dst);
		return dst;
	}

	private void toHexCharArray(char[] dst) {
		formatHexChar(dst, 0, w1);
		formatHexChar(dst, 8, w2);
		formatHexChar(dst, 16, w3);
		formatHexChar(dst, 24, w4);
		formatHexChar(dst, 32, w5);
	}

	private static final char[] hexchar = { '0', '1', '2', '3', '4', '5', '6',
			'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };

	static void formatHexChar(char[] dst, int p, int w) {
		int o = p + 7;
		while (o >= p && w != 0) {
			dst[o--] = hexchar[w & 0xf];
			w >>>= 4;
		}
		while (o >= p)
			dst[o--] = '0';
	}

	@SuppressWarnings("nls")
	@Override
	public String toString() {
		return "AnyObjectId[" + name() + "]";
	}

	/**
	 *
name.

	 *
	 * @return string form of the SHA-1, in lower case hexadecimal.
	 */
	public final String name() {
		return new String(toHexCharArray());
	}

	/**
	 * Get string form of the SHA-1, in lower case hexadecimal.
	 *
	 * @return string form of the SHA-1, in lower case hexadecimal.
	 */
	public final String getName() {
		return name();
	}

	/**
	 * Return an abbreviation (prefix) of this object SHA-1.
	 *

	 * This implementation does not guarantee uniqueness. Callers should instead
	 * use
	 * {@link org.eclipse.jgit.lib.ObjectReader#abbreviate(AnyObjectId, int)} to
	 * obtain a unique abbreviation within the scope of a particular object
	 * database.
	 *
	 * @param len
	 *            length of the abbreviated string.
	 * @return SHA-1 abbreviation.
	 */
	public AbbreviatedObjectId abbreviate(int len) {
		final int a = AbbreviatedObjectId.mask(len, 1, w1);
		final int b = AbbreviatedObjectId.mask(len, 2, w2);
		final int c = AbbreviatedObjectId.mask(len, 3, w3);
		final int d = AbbreviatedObjectId.mask(len, 4, w4);
		final int e = AbbreviatedObjectId.mask(len, 5, w5);
		return new AbbreviatedObjectId(len, a, b, c, d, e);
	}

	/**
	 * Obtain an immutable copy of this current object name value.
	 *

	 * Only returns this if this instance is an unsubclassed
	 * instance of {@link org.eclipse.jgit.lib.ObjectId}; otherwise a new
	 * instance is returned holding the same value.
	 *

	 * This method is useful to shed any additional memory that may be tied to
	 * the subclass, yet retain the unique identity of the object id for future
	 * lookups within maps and repositories.
	 *
	 * @return an immutable copy, using the smallest memory footprint possible.
	 */
	public final ObjectId copy() {
		if (getClass() == ObjectId.class)
			return (ObjectId) this;
		return new ObjectId(this);
	}

	/**
	 * Obtain an immutable copy of this current object name value.
	 *

	 * See {@link #copy()} if this is a possibly subclassed (but
	 * immutable) identity and the application needs a lightweight identity
	 * only reference.
	 *
	 * @return an immutable copy. May be this if this is already
	 *         an immutable instance.
	 */
	public abstract ObjectId toObjectId();
}

Answer: public final int getType() {

<think>
In RevTree.java, after the constructor the class overrides the abstract getType() method from RevObject. The snippet ends with an @Override annotation, so the next line should be the method signature for getType(), which is 'public int getType() {'. This matches the JGit source where RevTree returns Constants.OBJ_TREE.
</think>
public int getType() {


Input:
import cn.hutool.captcha.generator.RandomGenerator;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xht.cloud.framework.core.api.response.PageResponse;
import com.xht.cloud.framework.core.constant.CommonConstants;
import com.xht.cloud.framework.core.support.StringUtils;
import com.xht.cloud.framework.exception.Assert;
import com.xht.cloud.framework.exception.business.UserNameNotFountException;
import com.xht.cloud.framework.mybatis.core.DataScopeFieldBuilder;
import com.xht.cloud.framework.mybatis.core.enums.DataScopeTypeEnums;
import com.xht.cloud.framework.mybatis.handler.DataScopeFactory;
import com.xht.cloud.framework.mybatis.tool.PageTool;
import com.xht.cloud.framework.redis.key.RedisKeyTool;
import com.xht.cloud.framework.redis.service.RedisService;
import com.xht.cloud.framework.security.constant.UserTypeEnums;
import com.xht.cloud.framework.security.support.SecurityContextUtil;
import com.xht.cloud.system.enums.MenuTypeEnums;
import com.xht.cloud.system.manager.MinioManager;
import com.xht.cloud.system.module.dept.controller.response.SysDeptResponse;
import com.xht.cloud.system.module.dept.convert.SysDeptConvert;
import com.xht.cloud.system.module.dept.dao.dataobject.SysDeptDO;
import com.xht.cloud.system.module.dept.dao.mapper.SysDeptMapper;
import com.xht.cloud.system.module.permissions.dao.dataobject.SysMenuDO;
import com.xht.cloud.system.module.permissions.dao.dataobject.SysRoleDO;
import com.xht.cloud.system.module.permissions.dao.mapper.SysMenuMapper;
import com.xht.cloud.system.module.permissions.dao.mapper.SysRoleMapper;
import com.xht.cloud.system.module.user.controller.request.SysUserBaseAddUpdate;
import com.xht.cloud.system.module.user.controller.request.SysUserProfileRequest;
import com.xht.cloud.system.module.user.controller.request.SysUserQueryRequest;
import com.xht.cloud.system.module.user.controller.request.UpdatePassWordRequest;
import com.xht.cloud.system.module.user.controller.response.SysUserProfileResponse;
import com.xht.cloud.system.module.user.controller.response.SysUserResponse;
import com.xht.cloud.system.module.user.controller.response.SysUserVo;
import com.xht.cloud.system.module.user.convert.SysUserConvert;
import com.xht.cloud.system.module.user.convert.SysUserProfileConvert;
import com.xht.cloud.system.module.user.dao.dataobject.SysUserDO;
import com.xht.cloud.system.module.user.dao.dataobject.SysUserProfileDO;
import com.xht.cloud.system.module.user.dao.mapper.SysUserMapper;
import com.xht.cloud.system.module.user.dao.mapper.SysUserProfileMapper;
import com.xht.cloud.system.module.user.dao.wrapper.SysUserWrapper;
import com.xht.cloud.system.module.user.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

Context:
xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/service/impl/SysUserServiceImpl.java
package com.xht.cloud.system.module.user.service.impl;

/**
 * 描述 ：用户
 *
 * @author : xht
 **/
@Slf4j
@Service
@RequiredArgsConstructor

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/dept/dao/dataobject/SysDeptDO.java
@Data
@TableName(value = "sys_dept")
public class SysDeptDO extends BaseDO {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 父id
     */
    @TableField(value = "parent_id")
    private String parentId;

    /**
     * 指定主管ID(用户id)
     */
    @TableField(value = "director_id")
    private String directorId;

    /**
     * 部门名称
     */
    @TableField(value = "dept_name")
    private String deptName;

    /**
     * 部门编码
     */
    @TableField(value = "dept_code")
    private String deptCode;

    /**
     * 部门分类(0-境内 1境外)
     */
    @TableField(value = "dept_type")
    private String deptType;

    /**
     * 部门负责人
     */
    @TableField(value = "dept_leader")
    private String deptLeader;

    /**
     * 联系电话
     */
    @TableField(value = "dept_tel")
    private String deptTel;

    /**
     * 排序
     */
    @TableField(value = "dept_sort")
    private Integer deptSort;

    /**
     * 部门状态（0停用1正常）
     */
    @TableField(value = "dept_status")
    private String deptStatus;

    /**
     * 部门描述
     */
    @TableField(value = "description")
    private String description;

}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/dao/mapper/SysUserProfileMapper.java
@Mapper
public interface SysUserProfileMapper extends BaseMapperX<SysUserProfileDO> {

}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/controller/response/SysUserVo.java
@Data
public class SysUserVo {

    private SysUserResponse sysUser;

    private SysUserProfileResponse profile;

    /**
     * 角色编码
     */
    private Set<String> roleCode;

    /**
     * 数据权限 {@link com.xht.cloud.framework.mybatis.core.enums.DeptUserDataScopeEnum}
     */
    private Integer dataScope;

    /**
     * 菜单权限或者其他权限
     */
    private Set<String> authorities;

    /**
     * 部门信息
     */
    private SysDeptResponse dept;
}

xht-cloud-framework/xht-cloud-spring-boot-start-redis/src/main/java/com/xht/cloud/framework/redis/key/RedisKeyTool.java
public final class RedisKeyTool {

    private static final String DEFAULT_CONJUNCTION = ":";

    /**
     * 生成key
     */
    public static String createName(String... key) {
        return ArrayUtil.join(key, DEFAULT_CONJUNCTION);
    }

    /**
     * 格式化 Key
     *
     * @param args 格式化的参数
     * @return Key
     */
    public static String createNameTemplate(@NonNull final String keyTemplate, @NonNull Object... args) {
        return StrFormatter.format(keyTemplate, args);
    }

    /**
     * 生成key
     */
    public static RedisKeyBO createKey(String... key) {
        return new RedisKeyBO(createName(key));
    }

    /**
     * 生成key
     */
    public static RedisKeyBO createKeyTemplate(@NonNull final String keyTemplate, @NonNull Object... args) {
        return new RedisKeyBO(createNameTemplate(keyTemplate, args));
    }

}

xht-cloud-framework/xht-cloud-framework-exception/src/main/java/com/xht/cloud/framework/exception/Assert.java
public abstract class Assert {

    /**
     * 字符串为空抛出异常
     *
     * @param str 字符串
     */
    public static void hasText(String str) {
        hasText(str, "[Assertion failed] Must not empty");
    }

    /**
     * 字符串为空抛出异常
     *
     * @param str       字符串
     * @param errorCode 异常状态码
     */
    public static void hasText(String str, IErrorStatusCode errorCode) {
        if (!StringUtils.hasText(str)) {
            fail(errorCode);
        }
    }

    /**
     * 字符串为空抛出异常
     *
     * @param str        字符串
     * @param errMessage 异常描述
     */
    public static void hasText(String str, String errMessage) {
        if (!StringUtils.hasText(str)) {
            fail(errMessage);
        }
    }

    /**
     * 对象不为空抛出异常
     *
     * @param object    对象
     * @param errorCode 异常状态码
     */
    public static void notNull(Object object, IErrorStatusCode errorCode) {
        if (Objects.isNull(object)) {
            fail(errorCode);
        }
    }

    /**
     * 对象不为空抛出异常
     *
     * @param object     对象
     * @param errMessage 异常描述
     */
    public static void notNull(Object object, String errMessage) {
        if (Objects.isNull(object)) {
            fail(errMessage);
        }
    }

    /**
     * 对象不为空抛出异常
     *
     * @param object 对象
     */
    public static void notNull(Object object) {
        notNull(object, "[Assertion failed] Must not null");
    }

    /**
     * 集合为空排除异常
     *
     * @param collection 集合
     * @param errorCode  异常状态码
     */
    public static void notEmpty(Collection<?> collection, IErrorStatusCode errorCode) {
        if (Objects.isNull(collection) || collection.isEmpty()) {
            fail(errorCode);
        }
    }

    /**
     * 集合为空排除异常
     *
     * @param collection 集合
     * @param errMessage 异常信息
     */
    public static void notEmpty(Collection<?> collection, String errMessage) {
        if (Objects.isNull(collection) || collection.isEmpty()) {
            fail(errMessage);
        }
    }

    /**
     * 集合为空排除异常
     *
     * @param collection 集合
     */
    public static void notEmpty(Collection<?> collection) {
        notEmpty(collection, "[Assertion failed] Collection must not be empty: it must contain at least 1 element");
    }

    /**
     * map集合为空排除异常
     *
     * @param map       map集合
     * @param errorCode 异常状态码
     */
    public static void notEmpty(Map<?, ?> map, IErrorStatusCode errorCode) {
        if (Objects.isNull(map) || map.isEmpty()) {
            fail(errorCode);
        }
    }

    /**
     * map集合为空排除异常
     *
     * @param map        map集合
     * @param errMessage 异常信息
     */
    public static void notEmpty(Map<?, ?> map, String errMessage) {
        if (Objects.isNull(map) || map.isEmpty()) {
            fail(errMessage);
        }
    }

    /**
     * map集合为空排除异常
     *
     * @param map map集合
     */
    public static void notEmpty(Map<?, ?> map) {
        notEmpty(map, "[Assertion failed] Map must not be empty: it must contain at least one entry");
    }

    /**
     * 直接抛出异常
     *
     * @param s 异常描述信息
     */
    public static void fail(String s) {
        throw ExceptionFactory.bizException(s);
    }

    /**
     * 直接抛出异常
     *
     * @param errorStatusCode 异常状态码
     */
    public static void fail(IErrorStatusCode errorStatusCode) {
        throw ExceptionFactory.bizException(errorStatusCode);
    }

    /**
     * 断言是否为假，如果为 true 抛出{@link BizException}
     *
     * @param flag    布尔值
     * @param message 错误信息
     */
    public static void isFalse(boolean flag, String message) {
        isFalse(flag, () -> ExceptionFactory.bizException(message));
    }

    /**
     * 断言是否为假，如果为 {@code true} 抛出指定类型异常

     * 并使用指定的函数获取错误信息返回
     *

     *  Assert.isFalse(i > 0, ()->{
     *      // to query relation message
     *      return new IllegalArgumentException("relation message to return");
     *  });
     *

     *
     * @param <X>           异常类型
     * @param expression    布尔值
     * @param errorSupplier 指定断言不通过时抛出的异常
     * @throws X if expression is {@code false}
     */
    public static <X extends Throwable> void isFalse(boolean expression, Supplier<X> errorSupplier) throws X {
        if (expression) {
            throw errorSupplier.get();
        }
    }
}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/dao/wrapper/SysUserWrapper.java
public final class SysUserWrapper implements EntityWrapper<SysUserDO> {

    /**
     * 私有化构造器
     */
    private SysUserWrapper() {
    }

    /**
     * 获取实例
     */
    public static SysUserWrapper getInstance() {
        return Instance.INSTANCE.getInstance();
    }

    /**
     * 实例处理化
     */
    private enum Instance {

        INSTANCE;

        private final SysUserWrapper wrapper;

        Instance() {
            wrapper = new SysUserWrapper();
        }

        public SysUserWrapper getInstance() {
            return wrapper;
        }
    }

    /**
     * 获取 {@link LambdaQueryWrapper}
     *
     * @param entity 实体类
     * @return {@link LambdaQueryWrapper}
     */
    @Override
    public LambdaQueryWrapper<SysUserDO> lambdaQuery(SysUserDO entity) {
        if (Objects.isNull(entity)) {
            return lambdaQuery();
        }
        LambdaQueryWrapper<SysUserDO> wrapper = new LambdaQueryWrapper<>();
        return wrapper
                .eq(StringUtils.hasText(entity.getId()), SysUserDO::getId, entity.getId())
                .like(StringUtils.hasText(entity.getNickName()), SysUserDO::getNickName, entity.getNickName())
                .like(StringUtils.hasText(entity.getUserName()), SysUserDO::getUserName, entity.getUserName())
                .eq(StringUtils.hasText(entity.getPassWord()), SysUserDO::getPassWord, entity.getPassWord())
                .eq(StringUtils.hasText(entity.getPassWordSalt()), SysUserDO::getPassWordSalt, entity.getPassWordSalt())
                .eq(StringUtils.hasText(entity.getPassWordOld()), SysUserDO::getPassWordOld, entity.getPassWordOld())
                .eq(StringUtils.hasText(entity.getPassWordSaltOld()), SysUserDO::getPassWordSaltOld, entity.getPassWordSaltOld())
                .eq(StringUtils.hasText(entity.getDeptId()), SysUserDO::getDeptId, entity.getDeptId())
                .eq(StringUtils.hasText(entity.getUserAvatar()), SysUserDO::getUserAvatar, entity.getUserAvatar())
                .eq(StringUtils.hasText(entity.getUserType()), SysUserDO::getUserType, entity.getUserType())
                .eq(StringUtils.hasText(entity.getQqOpenid()), SysUserDO::getQqOpenid, entity.getQqOpenid())
                .eq(StringUtils.hasText(entity.getWxOpenid()), SysUserDO::getWxOpenid, entity.getWxOpenid())
                .eq(StringUtils.hasText(entity.getWxUnionid()), SysUserDO::getWxUnionid, entity.getWxUnionid())
                .eq(StringUtils.hasText(entity.getIsLock()), SysUserDO::getIsLock, entity.getIsLock())
                .eq(StringUtils.hasText(entity.getIsActive()), SysUserDO::getIsActive, entity.getIsActive())
                .eq(StringUtils.hasText(entity.getIsAdmin()), SysUserDO::getIsAdmin, entity.getIsAdmin())
                .eq(!ObjectUtils.isEmpty(entity.getRegisteredTime()), SysUserDO::getRegisteredTime, entity.getRegisteredTime())
                .eq(!ObjectUtils.isEmpty(entity.getLastLoginTime()), SysUserDO::getLastLoginTime, entity.getLastLoginTime())
                ;
    }

    /**
     * 获取 {@link LambdaUpdateWrapper}
     *
     * @param entity 实体类
     * @return {@link LambdaUpdateWrapper}
     */
    @Override
    public LambdaUpdateWrapper<SysUserDO> lambdaUpdate(SysUserDO entity) {
        if (Objects.isNull(entity)) {
            return lambdaUpdate();
        }
        LambdaUpdateWrapper<SysUserDO> wrapper = new LambdaUpdateWrapper<>();
        return wrapper
                .set(SysUserDO::getNickName, entity.getNickName())
                .set(SysUserDO::getUserName, entity.getUserName())
                .set(SysUserDO::getPassWord, entity.getPassWord())
                .set(SysUserDO::getPassWordSalt, entity.getPassWordSalt())
                .set(SysUserDO::getPassWordOld, entity.getPassWordOld())
                .set(SysUserDO::getPassWordSaltOld, entity.getPassWordSaltOld())
                .set(SysUserDO::getDeptId, entity.getDeptId())
                .set(SysUserDO::getUserAvatar, entity.getUserAvatar())
                .set(SysUserDO::getUserType, entity.getUserType())
                .set(SysUserDO::getQqOpenid, entity.getQqOpenid())
                .set(SysUserDO::getWxOpenid, entity.getWxOpenid())
                .set(SysUserDO::getWxUnionid, entity.getWxUnionid())
                .set(SysUserDO::getIsLock, entity.getIsLock())
                .set(SysUserDO::getIsActive, entity.getIsActive())
                .set(SysUserDO::getIsAdmin, entity.getIsAdmin())
                .set(SysUserDO::getRegisteredTime, entity.getRegisteredTime())
                .set(SysUserDO::getLastLoginTime, entity.getLastLoginTime())
                ;
    }

}

xht-cloud-framework/xht-cloud-spring-boot-start-security/src/main/java/com/xht/cloud/framework/security/support/SecurityContextUtil.java
public final class SecurityContextUtil {

    /**
     * 获取Authentication
     */
    public static Optional<Authentication> getAuthentication() {
        return Optional.ofNullable(SecurityContextHolder.getContext().getAuthentication());
    }

    /**
     *  判断用户是否登录
     * @return true 登录 false未登录
     */
    public static boolean isLogin() {
        Authentication authentication = getAuthentication().orElse(null);
        return Objects.nonNull(authentication) && authentication.isAuthenticated();
    }

    /**
     * 获取当前的登录账号
     *
     * @return 当前登录账号
     */
    public static String getUserName() {
        Authentication authentication = getAuthentication().orElse(null);
        if (Objects.nonNull(authentication)) {
            return authentication.getName();
        }
        return SecurityConstant.UNKNOWN_USER_NAME;
    }

    /**
     * 获取用户
     */
    public static Optional<CustomUserDetails> getUser() {
        if (isLogin()) {
            Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
            Object principal = authentication.getPrincipal();
            if (principal instanceof CustomUserDetails customUserDetails) {
                return Optional.of(customUserDetails);
            }
            return Optional.empty();
        }
        return Optional.empty();
    }

    /**
     * 检测当前token是否是客户端认证
     * @return  true 客户端认证
     */
    public static boolean isClientCredentials() {
        Authentication authentication = getAuthentication().orElse(null);
        if (Objects.isNull(authentication)) {
            return false;
        }
        return authentication.getPrincipal() instanceof OAuth2IntrospectionAuthenticatedPrincipal;
    }

    /**
     * @return 获取当前用户的数据权限
     */
    public static Integer getDataScope() {
        CustomUserDetails user = getUser().orElseThrow(() -> new RuntimeException("暂无权限查看，请联系管理员重新分配部门级数据权限！"));
        return user.getDataScope();
    }

    /**
     * 判断当前登录用户是不是管理员
     *
     * @return {@link Boolean} true 是 false不是
     */
    public static boolean isAdmin() {
        CustomUserDetails user = getUser().orElse(null);
        if (Objects.isNull(user)) {
            return Boolean.FALSE;
        }
        AdminProperties adminProperties = SpringUtil.getBean(AdminProperties.class);
        String include = adminProperties.getInclude();
        List<String> includes = adminProperties.getIncludes();
        Set<String> roleCode = adminProperties.getRoleCode();
        String usernameLogin = user.getUsername();
        List<String> roleCodeLogin = user.getAuthorities().stream().map(GrantedAuthority::getAuthority).toList();
        return Objects.equals(include, usernameLogin) || CollectionUtils.contains(includes.iterator(), usernameLogin) || CollectionUtils.containsAny(roleCode, roleCodeLogin);
    }

    /**
     * 判断当前用户是不是管理员
     *
     * @return {@link Boolean} true 是 false不是
     */
    public static Optional<Boolean> isAdmin(String userName) {
        AdminProperties adminProperties = SpringUtil.getBean(AdminProperties.class);
        String include = adminProperties.getInclude();
        List<String> includes = adminProperties.getIncludes();
        return Objects.equals(include, userName) || CollectionUtils.contains(includes.listIterator(), userName) ? Optional.of(true) : Optional.empty();
    }

    /**
     * 判断角色用户是不是管理员
     *
     * @return {@link Boolean} true 是 false不是
     */
    public static Optional<Boolean> isAdminRole(String roleCode) {
        AdminProperties adminProperties = SpringUtil.getBean(AdminProperties.class);
        Set<String> includes = adminProperties.getRoleCode();
        return CollectionUtils.contains(includes.iterator(), roleCode) ? Optional.of(true) : Optional.empty();
    }

    /**
     * 判断角色用户是不是管理员
     *
     * @return {@link Boolean} true 是 false不是
     */
    public static Optional<Boolean> isAdminRole(List<String> roleCode) {
        AdminProperties adminProperties = SpringUtil.getBean(AdminProperties.class);
        Set<String> includes = adminProperties.getRoleCode();
        return CollectionUtils.containsAny(includes, roleCode) ? Optional.of(true) : Optional.empty();
    }
}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/dao/dataobject/SysUserProfileDO.java
@Data
@TableName(value = "sys_user_profile")
public class SysUserProfileDO extends BaseDO {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private String userId;

    /**
     * 真实姓名
     */
    @TableField(value = "real_name")
    private String realName;

    /**
     * 性别，0：未知，1：男，2：女
     */
    @TableField(value = "gender")
    private String gender;

    /**
     * 身份证号码
     */
    @TableField(value = "id_card_number")
    private String idCardNumber;

    /**
     * 手机号码
     */
    @TableField(value = "phone_number")
    private String phoneNumber;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 生日
     */
    @TableField(value = "birthday")
    private LocalDateTime birthday;

    /**
     * 地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 详细地址
     */
    @TableField(value = "address_detailed")
    private String addressDetailed;

    /**
     * 个人描述
     */
    @TableField(value = "description")
    private String description;

}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/dao/dataobject/SysUserDO.java
@Data
@TableName(value = "sys_user")
public class SysUserDO extends BaseDO {

    /**
     * 用户ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 用户名(昵称)
     */
    @TableField(value = "nick_name")
    private String nickName;

    /**
     * 用户名(账号)
     */
    @TableField(value = "user_name")
    private String userName;

    /**
     * 密码
     */
    @TableField(value = "pass_word")
    private String passWord;

    /**
     * 密码盐值
     */
    @TableField(value = "pass_word_salt")
    private String passWordSalt;

    /**
     * 旧密码
     */
    @TableField(value = "pass_word_old")
    private String passWordOld;

    /**
     * 旧密码盐值
     */
    @TableField(value = "pass_word_salt_old")
    private String passWordSaltOld;

    /**
     * 部门id
     */
    @TableField(value = "dept_id")
    private String deptId;

    /**
     * 头像地址
     */
    @TableField(value = "user_avatar")
    private String userAvatar;

    /**
     * 账号类型，0 系统管理员 1 用户 2 商家
     */
    @TableField(value = "user_type")
    private String userType;

    /**
     * QQ互联openid
     */
    @TableField(value = "qq_openid")
    private String qqOpenid;

    /**
     * 微信openid
     */
    @TableField(value = "wx_openid")
    private String wxOpenid;

    /**
     * 微信unionid
     */
    @TableField(value = "wx_unionid")
    private String wxUnionid;

    /**
     * 是否锁定 0-锁定 1-正常
     */
    @TableField(value = "is_lock")
    private String isLock;

    /**
     * 是否激活，0-未激活，1-激活
     */
    @TableField(value = "is_active")
    private String isActive;

    /**
     * 是否超级管理员，0-不是，1-是
     */
    @TableField(value = "is_admin")
    private String isAdmin;

    /**
     * 注册时间
     */
    @TableField(value = "registered_time")
    private LocalDateTime registeredTime;

    /**
     * 最后一次登录时间
     */
    @TableField(value = "last_login_time")
    private LocalDateTime lastLoginTime;

}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/convert/SysUserProfileConvert.java
@Mapper(componentModel = "spring")
public interface SysUserProfileConvert {

    /**
     * {@link SysUserProfileRequest} to {@link SysUserProfileDO}
     */
    @Named(value = "addRequestToDo")
    SysUserProfileDO toDO(SysUserProfileRequest request);

    /**
     * {@link SysUserProfileDO} to {@link SysUserProfileResponse}
     */
    @Named(value = "DoToResponse")
    SysUserProfileResponse toResponse(SysUserProfileDO testDO);

    /**
     * list转换 {@link SysUserProfileDO} to {@link SysUserProfileResponse}
     */
    @Named(value = "DoToResponseCollection")
    @IterableMapping(qualifiedByName = "DoToResponse")
    List<SysUserProfileResponse> toResponse(List<SysUserProfileDO> testDO);

    /**
     * 分页转换 {@link SysUserProfileDO} to {@link SysUserProfileResponse}
     */
    default PageResponse<SysUserProfileResponse> toPageResponse(IPage<SysUserProfileDO> iPage) {
        if (Objects.nonNull(iPage)) {
            PageResponse<SysUserProfileResponse> pageResponse = PageTool.cloneEmpty(iPage);
            pageResponse.setList(toResponse(iPage.getRecords()));
            return pageResponse;
        }
        return PageTool.empty();
    }

}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/service/ISysUserService.java
public interface ISysUserService {

    /**
     * 创建
     *
     * @param request {@link SysUserBaseAddUpdate}
     * @return {@link String} 主键
     */
    String create(SysUserBaseAddUpdate request);

    /**
     * 根据id修改
     *
     * @param request {@link SysUserBaseAddUpdate}
     */
    String update(SysUserBaseAddUpdate request);

    /**
     * 删除
     *
     * @param ids {@link List<String>} id集合
     */
    void remove(List<String> ids);

    /**
     * 根据id查询详细
     *
     * @param id {@link String} 数据库主键
     * @return {@link SysUserResponse}
     */
    SysUserVo findById(String id);

    /**
     * 分页查询
     *
     * @param queryRequest {@link SysUserQueryRequest}
     * @return {@link PageResponse<SysUserResponse>} 分页详情
     */
    PageResponse<SysUserResponse> findPage(SysUserQueryRequest queryRequest);

    /**
     * 根据userName查询详细
     *
     * @param userName {@link String} 用户名称
     * @return {@link SysUserVo}
     */
    SysUserVo findByUserName(String userName);

    /**
     * 校验账号是否存在
     *
     * @param userName 用户名称
     * @return {@link Boolean}
     */
    boolean validationUserName(String userName);

    /**
     * 修改登录用户信息
     *
     * @param userName 账号
     * @param request  请求信息
     */
    void updateUserProfile(String userName, SysUserProfileRequest request);

    /**
     * 修改当前登录用户密码
     *
     * @param userName 账号
     * @param request  请求信息
     */
    void updateUserPassword(String userName, UpdatePassWordRequest request);

    /**
     * 重置账号密码
     *
     * @param userId 用户id
     */
    String resetUserPassword(String userId);

    /**
     * 修改当前登录用户头像
     *
     * @param userName    账号
     * @param inputStream 头像io流
     * @return 头像地址
     */
    String updateUserAvatar(String userName, InputStream inputStream);

}

xht-cloud-system/xht-cloud-system-service/src/main/java/com/xht/cloud/system/module/user/convert/SysUserConvert.java
@Mapper(componentModel = "spring")
public interface SysUserConvert {

    /**
     * {@link SysUserAddRequest} to {@link SysUserDO}
     */
    @Named(value = "requestToDo")
    SysUserDO toDO(SysUserAddRequest addRequest);

    /**
     * {@link SysUserUpdateRequest} to {@link SysUserDO}
     */
    @Named(value = "updateRequestToDo")
    SysUserDO toDO(SysUserUpdateRequest updateRequest);

    /**
     * {@link SysUserQueryRequest} to {@link SysUserDO}
     */
    @Named(value = "queryRequestToDo")
    SysUserDO toDO(SysUserQueryRequest queryRequest);

    /**
     * {@link SysUserDO} to {@link SysUserResponse}
     */
    @Named(value = "DoToResponse")
    SysUserResponse toResponse(SysUserDO testDO);

    /**
     * list转换 {@link SysUserDO} to {@link SysUserResponse}
     */
    @Named(value = "DoToResponseCollection")
    @IterableMapping(qualifiedByName = "DoToResponse")
    List<SysUserResponse> toResponse(List<SysUserDO> testDO);

    /**
     * 分页转换 {@link SysUserDO} to {@link SysUserResponse}
     */
    default PageResponse<SysUserResponse> toPageResponse(IPage<SysUserDO> iPage) {
        if (Objects.nonNull(iPage)) {
            PageResponse<SysUserResponse> pageResponse = PageTool.cloneEmpty(iPage);
            pageResponse.setList(toResponse(iPage.getRecords()));
            return pageResponse;
        }
        return PageTool.empty();
    }

    default UserResponseDTO toDTO(SysUserVo sysUserVo) {
        if (Objects.isNull(sysUserVo)) {
            return null;
        }
        SysUserResponse sysUser = sysUserVo.getSysUser();
        UserResponseDTO responseDTO = new UserResponseDTO();
        responseDTO.setId(sysUser.getId());
        responseDTO.setNickName(sysUser.getNickName());
        responseDTO.setUserName(sysUser.getUserName());
        responseDTO.setPassWord(sysUser.getPassWord());
        responseDTO.setPassWordSalt(sysUser.getPassWordSalt());
        responseDTO.setUserType(sysUser.getUserType());
        responseDTO.setQqOpenid(sysUser.getQqOpenid());
        responseDTO.setWxOpenid(sysUser.getWxOpenid());
        responseDTO.setWxUnionid(sysUser.getWxOpenid());
        responseDTO.setIsActive(sysUser.getIsActive());
        responseDTO.setIsAdmin(sysUser.getIsAdmin());
        responseDTO.setRegisteredTime(sysUser.getRegisteredTime());
        responseDTO.setLastLoginTime(sysUser.getLastLoginTime());
        responseDTO.setRoleCode(sysUserVo.getRoleCode());
        responseDTO.setDataScope(sysUserVo.getDataScope());
        responseDTO.setDeptId(sysUser.getDeptId());
        return responseDTO;
    }
}

Answer: public class SysUserServiceImpl implements ISysUserService {

<think>
The file shows package, comment, and class-level annotations (@Slf4j, @Service, @RequiredArgsConstructor). After the import statements, the next logical line is the class declaration that implements the service interface. In this project, service implementations are declared as 'public class <Name> implements ISysUserService {'. Therefore the next line should be the class declaration.
</think>
public class SysUserServiceImpl implements ISysUserService {