| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.translation; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import com.android.internal.util.DataClass; |
| 25 |
|
| 26 |
import java.util.Objects; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
@DataClass(genHiddenConstructor = true, genToString = true, genEqualsHashCode = true) |
| 32 |
public final class TranslationRequestValue implements Parcelable { |
| 33 |
|
| 34 |
@Nullable |
| 35 |
private final CharSequence mText; |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
@NonNull |
| 43 |
public static TranslationRequestValue forText(@NonNull CharSequence text) { |
| 44 |
Objects.requireNonNull(text, "text should not be null"); |
| 45 |
return new TranslationRequestValue(text); |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
@Nullable |
| 53 |
public CharSequence getText() { |
| 54 |
return mText; |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
@DataClass.Generated.Member |
| 78 |
public TranslationRequestValue( |
| 79 |
@Nullable CharSequence text) { |
| 80 |
this.mText = text; |
| 81 |
|
| 82 |
|
| 83 |
} |
| 84 |
|
| 85 |
@Override |
| 86 |
@DataClass.Generated.Member |
| 87 |
public String toString() { |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
return "TranslationRequestValue { " + |
| 92 |
"text = " + mText + |
| 93 |
" }"; |
| 94 |
} |
| 95 |
|
| 96 |
@Override |
| 97 |
@DataClass.Generated.Member |
| 98 |
public boolean equals(@Nullable Object o) { |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
if (this == o) return true; |
| 104 |
if (o == null || getClass() != o.getClass()) return false; |
| 105 |
@SuppressWarnings("unchecked") |
| 106 |
TranslationRequestValue that = (TranslationRequestValue) o; |
| 107 |
|
| 108 |
return true |
| 109 |
&& Objects.equals(mText, that.mText); |
| 110 |
} |
| 111 |
|
| 112 |
@Override |
| 113 |
@DataClass.Generated.Member |
| 114 |
public int hashCode() { |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
int _hash = 1; |
| 119 |
_hash = 31 * _hash + Objects.hashCode(mText); |
| 120 |
return _hash; |
| 121 |
} |
| 122 |
|
| 123 |
@Override |
| 124 |
@DataClass.Generated.Member |
| 125 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
byte flg = 0; |
| 130 |
if (mText != null) flg |= 0x1; |
| 131 |
dest.writeByte(flg); |
| 132 |
if (mText != null) dest.writeCharSequence(mText); |
| 133 |
} |
| 134 |
|
| 135 |
@Override |
| 136 |
@DataClass.Generated.Member |
| 137 |
public int describeContents() { return 0; } |
| 138 |
|
| 139 |
|
| 140 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 141 |
@DataClass.Generated.Member |
| 142 |
TranslationRequestValue(@NonNull Parcel in) { |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
byte flg = in.readByte(); |
| 147 |
CharSequence text = (flg & 0x1) == 0 ? null : (CharSequence) in.readCharSequence(); |
| 148 |
|
| 149 |
this.mText = text; |
| 150 |
|
| 151 |
|
| 152 |
} |
| 153 |
|
| 154 |
@DataClass.Generated.Member |
| 155 |
public static final @NonNull Parcelable.Creator<TranslationRequestValue> CREATOR |
| 156 |
= new Parcelable.Creator<TranslationRequestValue>() { |
| 157 |
@Override |
| 158 |
public TranslationRequestValue[] newArray(int size) { |
| 159 |
return new TranslationRequestValue[size]; |
| 160 |
} |
| 161 |
|
| 162 |
@Override |
| 163 |
public TranslationRequestValue createFromParcel(@NonNull Parcel in) { |
| 164 |
return new TranslationRequestValue(in); |
| 165 |
} |
| 166 |
}; |
| 167 |
|
| 168 |
@DataClass.Generated( |
| 169 |
time = 1620259864154L, |
| 170 |
codegenVersion = "1.0.23", |
| 171 |
sourceFile = "frameworks/base/core/java/android/view/translation/TranslationRequestValue.java", |
| 172 |
inputSignatures = "private final @android.annotation.Nullable java.lang.CharSequence mText\npublic static @android.annotation.NonNull android.view.translation.TranslationRequestValue forText(java.lang.CharSequence)\npublic @android.annotation.Nullable java.lang.CharSequence getText()\nclass TranslationRequestValue extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true, genToString=true, genEqualsHashCode=true)") |
| 173 |
@Deprecated |
| 174 |
private void __metadata() {} |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
} |