You mean you want to index out all children of a sealed class? Then I think this post will help you. Make sure that the implementation assumes that all the children of the class are directly-inheriting case objects. Also
scala.Enumeration can be used if those children need not specific implementation.
Short answer: No. See also this question
According to this old post on scala-lang the best way to achieve interoperability is to declare the enum in Java. I haven't found any reason to believe that has changed since then.
Using the different Scala variants will make your Java code look bad, and using Java enums from Scala is straight forward.
- Use Scala Case Objects for Java Enums?
- To use or not to use Scala for new Java projects?
- Scala spark: how to use dataset for a case class with the schema has snake_case?
- Can I use groovy templating instead of scala for Play 2.0 based Java applications?
- Scala - Java interop: can Scala emit enums in bytecode for Java to consume?
- Scala replacement for a Java enum pattern I use all the time
- Proper use of Scala traits and case objects
- In Scala 2.8, how to write (append) a line to a file? Should I use Java clesses or there are native Scala functions for this?
- defining a scala function1 for use by java has wrong types
- Is it possible to use scala objects in java file in android studio?
- what is the use case for scala List's companion function returning GenericCompanion?
- how to convert members of case class in Scala to List of Objects in Java
- How to use Avro serialization for scala case classes with Flink 1.7?
- Is it possible to get a Scala case class for an exisiting Java bean class?
- Instead of Scala Map objects, can we use any other proper objects for below type of structure?(Case Class)
- Optimal way to create implicit view for Java objects in Scala
- Group concat for Scala sequence of case objects
- get java class for type tag of Scala case class
- Case objects vs Enumerations in Scala
- What's the standard way to work with dates and times in Scala? Should I use Java types or there are native Scala alternatives?
- Enforcing Java version for Scala project in sbt?
- Should I use Unit or leave out the return type for my scala method?
- How to use Scala in IntelliJ IDEA (or: why is it so difficult to get a working IDE for Scala)?
- Setting up sbt to use Java 7 for compilation?
- Any way to use some Scala for iOS coding?
- The case for point free style in Scala
- What are the use cases for Scala 2.9's try...catch generalization?
- Is anyone using Scala in anger (and what advice for a Java programmer)?
- How to use Scala varargs from Java code
- when to use Classes vs Objects vs Case Classes vs Traits
More Query from same tag
- Why is there an implicit conversion from Float/Double to BigDecimal, but not from String?
- Spray-Json: How to parse a Json Array?
- Why does creating a map function whose parameter is of type `Nothing => U` appear to work?
- How to combine 2 Iterators in Scala?
- Do I need sbt scala package builder for pyspark scripts?
- Play Framework + Angular Issue with JSON render on Page
- Scala Compiler TypeRef to ClassDef
- Custom error message for gatling assertions
- Dealias in class scope
- Multiple OR filtering with Slick
- Spark 1.6 scala create data rows
- Scala recursion, overflow
- Flink's operator state example won't compile (java.lang.Iterable vs. scala.collection.Iterable)
- How can I import all unimported classes in Scala IDE?
- Dynamically find the optimal number of Actors
- reading a large file and processing section by section
- Passing sys props to Spark 1.5 especially properties with spaces in it
- How to apply new changes without dropping current data in the db.(Playframework evaluations)
- Eliminate duplicates, change label with scala.xml.transform.RuleTransformer
- Ruby's instance_eval equivalent in Scala for building DSLs
- IntelliJ not creating/importing new Play Framework project correctly
- Update columns of spark dataframe which are of type Map with desired key and value
- missing dependency detected during test using scalamock
- spark streaming multiple sockets sources
- How to repeat a message to console using a schedule
- Lift POST REST request on Lift always ends in 404
- Scala mutable MultiMap addBinding and insert order preservation
- Rendering images with Processing.org on Java servlet
- Pattern matching..error says Error:(11, 11) type mismatch; found : Unit
- how does work scalaz.Validation loopSuccess and loopFailure