Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin, non-builder: chunk redact function every 100 fields #3214

Merged
merged 5 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions wire-golden-files/src/main/kotlin/Field.kt
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
}
}
Loading
Loading