Skip to content

Commit

Permalink
Use abstract class instead of sealed classes for StringFormat (#6334)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
rlazo authored Oct 3, 2024
1 parent 48aab50 commit 87b6d12
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.google.firebase.vertexai.type

public sealed class StringFormat(public val value: String) {
public class Custom(format: String) : StringFormat(format)
public abstract class StringFormat private constructor(internal val value: String) {
public class Custom(value: String) : StringFormat(value)
}

/** Represents a schema */
Expand Down

0 comments on commit 87b6d12

Please sign in to comment.