Skip to content
View joshiraez's full-sized avatar
  • Red Hat
  • Seville, Spain
Block or Report

Block or report joshiraez

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. Calculator done with enums for the o... Calculator done with enums for the operation
    1
    public class EnumCalculator {
    2
    
                  
    3
        //Notice how concise the code has become in the logic
    4
    
                  
    5
        public int calculate(char op, int a, int b) {
  2. Third example for "Rethinking interf... Third example for "Rethinking interfaces". Now making totally equivalent our "interface class" to implement our interface.
    1
    class OperationInterfaceAsClass implements Operation {
    2
    
                  
    3
        Predicate<String>                   isOperation;
    4
        Function<List<Integer>, Integer>    operate;
    5
    
                  
  3. How would you create classic instanc... How would you create classic instances using this aproach, creating a factory. "Rethinking interfaces"
    1
    class OperationWithOperationData {
    2
    
                  
    3
        Predicate<String>                   isOperation;
    4
        IntBinaryOperator                   reductionOperation;
    5
        List<Integer>                       toOperateOn;
  4. Creating Data classes interfaces. Re... Creating Data classes interfaces. Rethinking interfaces in medium
    1
    class CharacterData {
    2
        int HP;
    3
        int attack;
    4
        int defense;
    5
    
                  
  5. Transforming it to an abstract appro... Transforming it to an abstract approach instead of interface approach (having some part of the code already implemented).
    1
    class OperationAbstractAsClass implements Operation {
    2
    
                  
    3
        Predicate<String>                   isOperation;
    4
        IntBinaryOperator                   reductionOperation;
    5
    
                  
  6. Toy compresser Toy compresser
    1
    package com.company;
    2
    
                  
    3
    import java.util.*;
    4
    import java.util.stream.Collectors;
    5
    import java.util.stream.IntStream;