public void applyFractionDefaults(Server server) throws Exception { Set<Class<? extends Fraction>> availFractions = server.getFractionTypes(); // Process any dependent fractions from Application added fractions if (!this.dependentFractions.isEmpty()) { this.dependentFractions.stream().filter(dependentFraction -> this.fractions.get(dependentFraction.getClass()) == null).forEach(this::fraction); this.dependentFractions.clear(); } // Provide defaults for those remaining availFractions.stream().filter(fractionClass -> this.fractions.get(fractionClass) == null).forEach(fractionClass -> fractionDefault(server.createDefaultFor(fractionClass))); // Determine if any dependent fractions should override non Application added fractions if (!this.dependentFractions.isEmpty()) { this.dependentFractions.stream().filter(dependentFraction -> this.fractions.get(dependentFraction.getClass()) == null || (this.fractions.get(dependentFraction.getClass()) != null && this.defaultFractionTypes.contains(dependentFraction.getClass()))).forEach(this::fraction); this.dependentFractions.clear(); } }
public void applyFractionDefaults(Server server) throws Exception { Set<Class<? extends Fraction>> availFractions = server.getFractionTypes(); // Process any dependent fractions from Application added fractions if (!this.dependentFractions.isEmpty()) { this.dependentFractions.stream().filter(dependentFraction -> this.fractions.get(dependentFraction.getClass()) == null).forEach(this::fraction); this.dependentFractions.clear(); } // Provide defaults for those remaining availFractions.stream().filter(fractionClass -> this.fractions.get(fractionClass) == null).forEach(fractionClass -> fractionDefault(server.createDefaultFor(fractionClass))); // Determine if any dependent fractions should override non Application added fractions if (!this.dependentFractions.isEmpty()) { this.dependentFractions.stream().filter(dependentFraction -> this.fractions.get(dependentFraction.getClass()) == null || (this.fractions.get(dependentFraction.getClass()) != null && this.defaultFractionTypes.contains(dependentFraction.getClass()))).forEach(this::fraction); this.dependentFractions.clear(); } }
public void applyFractionDefaults(Server server) throws Exception { Set<Class<? extends Fraction>> availFractions = server.getFractionTypes(); // Process any dependent fractions from Application added fractions if (!this.dependentFractions.isEmpty()) { this.dependentFractions.stream() .filter(dependentFraction -> this.fractions.get(dependentFraction.getClass()) == null) .forEach(this::fraction); this.dependentFractions.clear(); } // Provide defaults for those remaining availFractions.stream() .filter(fractionClass -> this.fractions.get(fractionClass) == null) .forEach(fractionClass -> fractionDefault(server.createDefaultFor(fractionClass))); // Determine if any dependent fractions should override non Application added fractions if (!this.dependentFractions.isEmpty()) { this.dependentFractions.stream() .filter(dependentFraction -> this.fractions.get(dependentFraction.getClass()) == null || (this.fractions.get(dependentFraction.getClass()) != null && this.defaultFractionTypes.contains(dependentFraction.getClass()))) .forEach(this::fraction); this.dependentFractions.clear(); } }