Skip to content

Commit 87b6d12

Browse files
authored
Use abstract class instead of sealed classes for StringFormat (#6334)
`sealed` classes have nice properties but they don't play well with API backward compatibility. Adding a new class to a `sealed` class set is a breaking change since they require exhaustive switching.
1 parent 48aab50 commit 87b6d12

File tree

1 file changed

+2
-2
lines changed
  • firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type

1 file changed

+2
-2
lines changed

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/Schema.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package com.google.firebase.vertexai.type
1818

19-
public sealed class StringFormat(public val value: String) {
20-
public class Custom(format: String) : StringFormat(format)
19+
public abstract class StringFormat private constructor(internal val value: String) {
20+
public class Custom(value: String) : StringFormat(value)
2121
}
2222

2323
/** Represents a schema */

0 commit comments

Comments
 (0)