test_class.declarator: payload
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MySQLPacketPayload payload;
test_class.type: MySQLPacketPayload
test_class.var_name: payload
test_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/protocol/MySQLDateBinaryProtocolValueTest.java
test_class.identifier: MySQLDateBinaryProtocolValueTest
test_case.body: @Test
      public void assertWriteWithSevenBytes() {
          MySQLDateBinaryProtocolValue actual = new MySQLDateBinaryProtocolValue();
          actual.write(payload, Timestamp.valueOf("1970-01-14 12:10:30"));
          verify(payload).writeInt1(7);
          verify(payload).writeInt2(1970);
          verify(payload).writeInt1(1);
          verify(payload).writeInt1(14);
          verify(payload).writeInt1(12);
          verify(payload).writeInt1(10);
          verify(payload).writeInt1(30);
      }
test_case.class_method_signature: MySQLDateBinaryProtocolValueTest.assertWriteWithSevenBytes()
test_case.full_signature: @Test public void assertWriteWithSevenBytes()
test_case.identifier: assertWriteWithSevenBytes
test_case.invocations: write valueOf writeInt1 verify writeInt2 verify writeInt1 verify writeInt1 verify writeInt1 verify writeInt1 verify writeInt1 verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertWriteWithSevenBytes()
focal_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/protocol/MySQLDateBinaryProtocolValue.java
focal_class.identifier: MySQLDateBinaryProtocolValue
focal_class.interfaces: implements MySQLBinaryProtocolValue
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.read(final MySQLPacketPayload payload)
focal_class.full_signature: @Override public Object read(final MySQLPacketPayload payload)
focal_class.identifier: read
focal_class.modifiers: @Override public
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: Object
focal_class.signature: Object read(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.getTimestampForDate(final MySQLPacketPayload payload)
focal_class.full_signature: @SuppressWarnings("MagicConstant") private Timestamp getTimestampForDate(final MySQLPacketPayload payload)
focal_class.identifier: getTimestampForDate
focal_class.modifiers: @SuppressWarnings("MagicConstant") private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: Timestamp
focal_class.signature: Timestamp getTimestampForDate(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.getTimestampForDatetime(final MySQLPacketPayload payload)
focal_class.full_signature: @SuppressWarnings("MagicConstant") private Timestamp getTimestampForDatetime(final MySQLPacketPayload payload)
focal_class.identifier: getTimestampForDatetime
focal_class.modifiers: @SuppressWarnings("MagicConstant") private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: Timestamp
focal_class.signature: Timestamp getTimestampForDatetime(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.write(final MySQLPacketPayload payload, final Object value)
focal_class.full_signature: @Override public void write(final MySQLPacketPayload payload, final Object value)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (final MySQLPacketPayload payload, final Object value)
focal_class.return: void
focal_class.signature: void write(final MySQLPacketPayload payload, final Object value)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.writeDate(final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.full_signature: private void writeDate(final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.identifier: writeDate
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.return: void
focal_class.signature: void writeDate(final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.writeTime(final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.full_signature: private void writeTime(final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.identifier: writeTime
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.return: void
focal_class.signature: void writeTime(final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.writeNanos(final MySQLPacketPayload payload, final int nanos)
focal_class.full_signature: private void writeNanos(final MySQLPacketPayload payload, final int nanos)
focal_class.identifier: writeNanos
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload, final int nanos)
focal_class.return: void
focal_class.signature: void writeNanos(final MySQLPacketPayload payload, final int nanos)
focal_method.body: @Override
      public void write(final MySQLPacketPayload payload, final Object value) {
          Timestamp timestamp = (Timestamp) value;
          Calendar calendar = Calendar.getInstance();
          calendar.setTime(timestamp);
          int year = calendar.get(Calendar.YEAR);
          int month = calendar.get(Calendar.MONTH) + 1;
          int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
          int hourOfDay = calendar.get(Calendar.HOUR_OF_DAY);
          int minutes = calendar.get(Calendar.MINUTE);
          int seconds = calendar.get(Calendar.SECOND);
          int nanos = timestamp.getNanos();
          boolean isTimeAbsent = 0 == hourOfDay && 0 == minutes && 0 == seconds;
          boolean isNanosAbsent = 0 == nanos;
          if (isTimeAbsent && isNanosAbsent) {
              payload.writeInt1(4);
              writeDate(payload, year, month, dayOfMonth);
              return;
          }
          if (isNanosAbsent) {
              payload.writeInt1(7);
              writeDate(payload, year, month, dayOfMonth);
              writeTime(payload, hourOfDay, minutes, seconds);
              return;
          }
          payload.writeInt1(11);
          writeDate(payload, year, month, dayOfMonth);
          writeTime(payload, hourOfDay, minutes, seconds);
          writeNanos(payload, nanos);
      }
focal_method.class_method_signature: MySQLDateBinaryProtocolValue.write(final MySQLPacketPayload payload, final Object value)
focal_method.full_signature: @Override public void write(final MySQLPacketPayload payload, final Object value)
focal_method.identifier: write
focal_method.invocations: getInstance setTime get get get get get get getNanos writeInt1 writeDate writeInt1 writeDate writeTime writeInt1 writeDate writeTime writeNanos
focal_method.modifiers: @Override public
focal_method.parameters: (final MySQLPacketPayload payload, final Object value)
focal_method.return: void
focal_method.signature: void write(final MySQLPacketPayload payload, final Object value)