Package com.altibase.document.impl
Record Class InsertResultImpl
java.lang.Object
java.lang.Record
com.altibase.document.impl.InsertResultImpl
- Record Components:
keyValue- 삽입된 문서의 키 값keyType- 삽입된 키의 자바Class타입affectedDocCount- 영향을 받은 문서의 수 (일반적으로 1)
- All Implemented Interfaces:
InsertResult,UpdateResult
public record InsertResultImpl(Object keyValue, Class<?> keyType, long affectedDocCount)
extends Record
implements InsertResult
InsertResult 인터페이스의 기본 구현 레코드이다.
삽입 연산의 결과로 얻은 키 값, 키 타입, 영향을 받은 문서 수를 담는 불변(Immutable) 데이터 객체로 동작한다.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInsertResultImpl(Object keyValue, Class<?> keyType, long affectedDocCount) Creates an instance of aInsertResultImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theaffectedDocCountrecord component.final booleanIndicates whether some other object is "equal to" this one.long연산으로 인해 영향을 받은 문서의 수를 반환한다.Class<?>삽입된 문서의 키에 해당하는 자바Class타입을 반환한다.삽입된 문서의 키 값을Object타입으로 반환한다.final inthashCode()Returns a hash code value for this object.Class<?>keyType()Returns the value of thekeyTyperecord component.keyValue()Returns the value of thekeyValuerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.altibase.document.api.InsertResult
getIntegerKey, getLongKey, getShortKey, getStringKey
-
Constructor Details
-
InsertResultImpl
Creates an instance of aInsertResultImplrecord class.- Parameters:
keyValue- the value for thekeyValuerecord componentkeyType- the value for thekeyTyperecord componentaffectedDocCount- the value for theaffectedDocCountrecord component
-
-
Method Details
-
getKeyValue
삽입된 문서의 키 값을Object타입으로 반환한다.반환된 값은 실제 키 타입에 맞게 캐스팅하여 사용해야 한다. 타입 안전성이 필요하다면
getIntegerKey(),getStringKey()등 타입별 편의 메서드 사용을 권장한다.- Specified by:
getKeyValuein interfaceInsertResult- Returns:
- 키 값 (Object 타입)
-
getKeyType
삽입된 문서의 키에 해당하는 자바Class타입을 반환한다.이 정보는 타입별 편의 메서드 내부에서 타입 검증을 위해 사용된다.
- Specified by:
getKeyTypein interfaceInsertResult- Returns:
- 키의 Class 타입
-
getAffectedDocCount
public long getAffectedDocCount()연산으로 인해 영향을 받은 문서의 수를 반환한다.예를 들어,
deleteMany연산의 경우 삭제된 문서의 총 개수를 반환하고,replaceOne연산의 경우 교체된 문서의 수(일반적으로 1 또는 0)를 반환한다.- Specified by:
getAffectedDocCountin interfaceUpdateResult- Returns:
- 갱신, 교체, 또는 삭제된 문서의 총 개수
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
keyValue
Returns the value of thekeyValuerecord component.- Returns:
- the value of the
keyValuerecord component
-
keyType
Returns the value of thekeyTyperecord component.- Returns:
- the value of the
keyTyperecord component
-
affectedDocCount
public long affectedDocCount()Returns the value of theaffectedDocCountrecord component.- Returns:
- the value of the
affectedDocCountrecord component
-