Skip to content

Commit

Permalink
fix relation enum declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitry Polivaev committed Aug 6, 2017
1 parent 315d1f5 commit c67514a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
@@ -1,8 +1,12 @@
package com.mercateo.common.rest.schemagen.link.relation;

public interface RelationEnum<E extends Enum<E> & RelationEnum<E>> extends RelationContainer {
public interface RelationEnum extends RelationContainer {

public String name();

@Override
default public Relation getRelation() {
return Relation.of(((Enum<?>)this).name().toLowerCase().replace('_', '-'));
return Relation.of(name().toLowerCase().replace('_', '-'));
}

}
Expand Up @@ -5,7 +5,7 @@
import org.junit.Test;

public class RelationEnumTest{
enum TestRelation implements RelationEnum<TestRelation>{
enum TestRelation implements RelationEnum{
TEST_RELATION
}

Expand Down

0 comments on commit c67514a

Please sign in to comment.