-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kotlin, non-builder: chunk redact function every 100 fields (#3214)
* Kotlin, non-builder: chunk redact function every 100 fields * avoid impacting other tests * spotless * remove debug log * Golden file + refactoring --------- Co-authored-by: Benoît Quenaudon <benoit@quenaudon.com>
- Loading branch information
Showing
4 changed files
with
5,313 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Code generated by Wire protocol buffer compiler, do not edit. | ||
// Source: Field in squareup/wire/hundreds_redacted.proto | ||
@file:Suppress( | ||
"DEPRECATION", | ||
"RUNTIME_ANNOTATION_NOT_SUPPORTED", | ||
) | ||
|
||
import com.squareup.wire.FieldEncoding | ||
import com.squareup.wire.Message | ||
import com.squareup.wire.ProtoAdapter | ||
import com.squareup.wire.ProtoReader | ||
import com.squareup.wire.ProtoWriter | ||
import com.squareup.wire.ReverseProtoWriter | ||
import com.squareup.wire.Syntax.PROTO_3 | ||
import com.squareup.wire.`internal`.JvmField | ||
import kotlin.Any | ||
import kotlin.AssertionError | ||
import kotlin.Boolean | ||
import kotlin.Deprecated | ||
import kotlin.DeprecationLevel | ||
import kotlin.Int | ||
import kotlin.Long | ||
import kotlin.Nothing | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import okio.ByteString | ||
|
||
public class Field( | ||
unknownFields: ByteString = ByteString.EMPTY, | ||
) : Message<Field, Nothing>(ADAPTER, unknownFields) { | ||
@Deprecated( | ||
message = "Shouldn't be used in Kotlin", | ||
level = DeprecationLevel.HIDDEN, | ||
) | ||
override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (other === this) return true | ||
if (other !is Field) return false | ||
if (unknownFields != other.unknownFields) return false | ||
return true | ||
} | ||
|
||
override fun hashCode(): Int = unknownFields.hashCode() | ||
|
||
override fun toString(): String = "Field{}" | ||
|
||
public fun copy(unknownFields: ByteString = this.unknownFields): Field = Field(unknownFields) | ||
|
||
public companion object { | ||
@JvmField | ||
public val ADAPTER: ProtoAdapter<Field> = object : ProtoAdapter<Field>( | ||
FieldEncoding.LENGTH_DELIMITED, | ||
Field::class, | ||
"type.googleapis.com/Field", | ||
PROTO_3, | ||
null, | ||
"squareup/wire/hundreds_redacted.proto" | ||
) { | ||
override fun encodedSize(`value`: Field): Int { | ||
var size = value.unknownFields.size | ||
return size | ||
} | ||
|
||
override fun encode(writer: ProtoWriter, `value`: Field) { | ||
writer.writeBytes(value.unknownFields) | ||
} | ||
|
||
override fun encode(writer: ReverseProtoWriter, `value`: Field) { | ||
writer.writeBytes(value.unknownFields) | ||
} | ||
|
||
override fun decode(reader: ProtoReader): Field { | ||
val unknownFields = reader.forEachTag(reader::readUnknownField) | ||
return Field( | ||
unknownFields = unknownFields | ||
) | ||
} | ||
|
||
override fun redact(`value`: Field): Field = value.copy( | ||
unknownFields = ByteString.EMPTY | ||
) | ||
} | ||
|
||
private const val serialVersionUID: Long = 0L | ||
} | ||
} |
Oops, something went wrong.