Skip to content

Commit

Permalink
Remove celVarToDecl method
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 646579113
  • Loading branch information
l46kok authored and copybara-github committed Jun 25, 2024
1 parent f2d2635 commit 0e2fd64
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions common/src/main/java/dev/cel/common/CelVarDecl.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@

package dev.cel.common;

import dev.cel.expr.Decl;
import dev.cel.expr.Decl.IdentDecl;
import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import com.google.errorprone.annotations.CheckReturnValue;
import dev.cel.common.types.CelType;
import dev.cel.common.types.CelTypes;

/** Abstract representation of a CEL variable declaration. */
@AutoValue
Expand All @@ -37,13 +33,4 @@ public abstract class CelVarDecl {
public static CelVarDecl newVarDeclaration(String name, CelType type) {
return new AutoValue_CelVarDecl(name, type);
}

/** Converts a {@link CelVarDecl} to a protobuf equivalent form {@code Decl} */
@VisibleForTesting
public static Decl celVarToDecl(CelVarDecl varDecl) {
return Decl.newBuilder()
.setName(varDecl.name())
.setIdent(IdentDecl.newBuilder().setType(CelTypes.celTypeToType(varDecl.type())))
.build();
}
}

0 comments on commit 0e2fd64

Please sign in to comment.