Skip to content

Commit

Permalink
java: Align {get,set}Sym to use Symbology enum
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed Apr 4, 2024
1 parent 3792723 commit 5af5beb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java/org/gs1/gs1encoders/GS1Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ public String getVersion() {
* - gs1_encoder_getVersion()
*
*/
public int getSym() {
return gs1encoderGetSymJNI(ctx);
public Symbology getSym() {
return Symbology.values()[gs1encoderGetSymJNI(ctx) + 1];
}

/**
Expand All @@ -283,8 +283,8 @@ public int getSym() {
* - gs1_encoder_setVersion()
*
*/
public void setSym(int value) throws GS1EncoderParameterException {
if (!gs1encoderSetSymJNI(ctx, value))
public void setSym(Symbology value) throws GS1EncoderParameterException {
if (!gs1encoderSetSymJNI(ctx, value.ordinal() - 1))
throw new GS1EncoderParameterException(this.getErrMsg());
}

Expand Down

0 comments on commit 5af5beb

Please sign in to comment.