Questions tagged as 'java-8'

1
answer

What is the difference between Kotlin data class and Scala case class?

In Scala we have case classes , for example: case class Pessoa(nome: String, sobrenome: String) and in Kotlin we have data classes : data class Pessoa( val nome: String, val sobrenome: String ) What's the difference between...
asked by 10.07.2016 / 13:36
2
answers

How to reproduce relationship in Objects?

According to the definition of this site :    CARDINALITY       It is the maximum and minimum number of occurrences of an entity that are   associated with the occurrences of another entity that participates in the   relationship. That is...
asked by 11.03.2016 / 03:17
1
answer

How to know if the list contains both elements that meet and that do not meet a condition, using stream?

I have a list of columns, I need to know if this list contains both columns that are keys as columns that are not keys.    I guarantee the existence of at least one column in the list My column class: public class Coluna { public bool...
asked by 14.06.2018 / 15:41
1
answer

Error while deploying EJB project with lambda using glassfish 4

I have two java files in my project First.java package br.com.bom; import javax.ejb.Stateless; @Stateless public class Primeiro { } Second.java package br.com.bom; import javax.ejb.Stateless; import java.util.ArrayList; import j...
asked by 17.09.2015 / 13:15
0
answers

Error when deploying on Wildfly 8: Failed to define class

I'm getting the error below when trying to deploy my application after migrating from JBoss AS 7.1 to Wildfly 8.2 and from Java 7 to Java 8 and still can not identify the source of this error. I'm using Wildfly 8.2, Primefaces 5.1 and JSF 2.2...
asked by 29.07.2015 / 14:41
2
answers

How to filter a HashMap returning another HashMap using Java 8 lambda?

The following code runs through Set and filters only objects that isActive() is true . public Set<InvoiceLineDocument> getActiveLines() { Set<InvoiceLineDocument> activeLines = new HashSet<>();...
asked by 15.05.2018 / 20:15
1
answer

Code review: Simple MVC

Hello world! I tried to make a very simple MVC in JavaFX. My model is a Pessoa class that has nome and idade (the idade field in case it does not get used). Two text fields represent two views. For simplicity bot...
asked by 05.06.2018 / 16:21
1
answer

How to Distribute RIA with JNLP and Java 8

I developed an application and at the time of distributing with JNLP, I encountered a deadlock. With Java 8, it asks to sign the JARs and the certificate must be from a recognized CA. I signed the JARs with a certificate generated by me (only...
asked by 16.04.2015 / 12:16
1
answer

Did the functional features of Java 8 make some design pattern obsolete?

Functional programming is said to make certain design patterns (thinking GoF) unnecessary. There's even a presentation showing it somewhere (I'm not looking now because I'm on my cell phone). Have the functional features of Java 8 made any de...
asked by 23.03.2017 / 17:56
1
answer

Stream - findFirst vs findAny

The Stream class has two very similar methods, findFirst and findAny . Both return a Optional<T> with an item (or empty if Stream is empty). The findFirst returns the first found item. In prac...
asked by 13.05.2015 / 16:43