Skip to content

Commit

Permalink
Added another enumConstantRef overload (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Apr 15, 2019
1 parent 50c78ed commit d5620e0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/java/com/helger/jcodemodel/AbstractJClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,9 @@ public final JLambdaMethodRef methodRef (@Nonnull final String sMethod)
}

/**
* @param Enumeration
* constant name. May neither be <code>null</code> nor empty.
* @param sName
* Enumeration constant name. May neither be <code>null</code> nor
* empty.
* @return <code>class.name</code>
* @since 3.2.4
*/
Expand All @@ -561,6 +562,18 @@ public final IJExpression enumConstantRef (@Nonnull final String sName)
return JExpr.enumConstantRef (this, sName);
}

/**
* @param aEnumEntry
* Enumeration item. May not be <code>null</code>.
* @return <code>class.name</code>
* @since 3.2.4
*/
@Nonnull
public final IJExpression enumConstantRef (@Nonnull final Enum <?> aEnumEntry)
{
return enumConstantRef (aEnumEntry.name ());
}

public void generate (@Nonnull final IJFormatter f)
{
f.type (this);
Expand Down

0 comments on commit d5620e0

Please sign in to comment.