Skip to content

Commit

Permalink
strings enum
Browse files Browse the repository at this point in the history
  • Loading branch information
l3r8yJ committed Mar 25, 2023
1 parent a7928a5 commit 25b5238
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
24 changes: 22 additions & 2 deletions src/main/java/io/github/eocqrs/kafka/xml/KfCustomer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@
* @since 0.0.2
*/
public enum KfCustomer {
CONSUMER,
PRODUCER
CONSUMER("consumer"),
PRODUCER("producer");

/**
* The name.
*/
private final String name;

/**
* Ctor.
*
* @param name The name.
*/
KfCustomer(final String name) {
this.name = name;
}


@Override
public String toString() {
return this.name;
}
}
3 changes: 1 addition & 2 deletions src/main/java/io/github/eocqrs/kafka/xml/XmlMapParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import com.jcabi.xml.XML;
import com.jcabi.xml.XMLDocument;
import lombok.RequiredArgsConstructor;
import org.cactoos.Input;
import org.cactoos.Scalar;
import org.cactoos.io.ResourceOf;
Expand Down Expand Up @@ -93,7 +92,7 @@ protected XmlMapParams(final String name, final KfCustomer cust) throws Exceptio

@Override
public final Map<String, Object> value() throws Exception {
final String parent = this.customer.toString().toLowerCase(Locale.ROOT);
final String parent = this.customer.toString();
return new XMLDocument(this.configuration.toString())
.nodes(new Concatenated("//", parent, "/*").toString())
.stream()
Expand Down

0 comments on commit 25b5238

Please sign in to comment.