public static void registerLegacyCustomClassesForJSON(List<Pair<String,Class>> classes){
        for(Pair<String,Class> p : classes){
            String s = p.getFirst();
            Class c = p.getRight();
            //Check if it's a valid class to register...
            boolean found = false;
            for( Class<?> c2 : REGISTERABLE_CUSTOM_CLASSES){
                if(c2.isAssignableFrom(c)){
                    if(c2 == Layer.class){
                        LegacyLayerDeserializer.registerLegacyClassSpecifiedName(s, (Class<? extends Layer>)c);
                    } else if(c2 == GraphVertex.class){
                        LegacyGraphVertexDeserializer.registerLegacyClassSpecifiedName(s, (Class<? extends GraphVertex>)c);
                    } else if(c2 == InputPreProcessor.class){
                        LegacyPreprocessorDeserializer.registerLegacyClassSpecifiedName(s, (Class<? extends InputPreProcessor>)c);
                    } else if(c2 == IActivation.class ){
                        LegacyIActivationDeserializer.registerLegacyClassSpecifiedName(s, (Class<? extends IActivation>)c);
                    } else if(c2 == ILossFunction.class ){
                        LegacyILossFunctionDeserializer.registerLegacyClassSpecifiedName(s, (Class<? extends ILossFunction>)c);
                    } else if(c2 == ReconstructionDistribution.class){
                        LegacyReconstructionDistributionDeserializer.registerLegacyClassSpecifiedName(s, (Class<? extends ReconstructionDistribution>)c);
                    }

                    found = true;
                }
            }

            if(!found){
                throw new IllegalArgumentException("Cannot register class for legacy JSON deserialization: class " +
                        c.getName() + " is not a subtype of classes " + REGISTERABLE_CUSTOM_CLASSES);
            }
        }
    }
public static void registerLegacyCustomClassesForJSON ( List < Pair < String , Class > > classes ) { for ( Pair < String , Class > p : classes ) { String s = p . getFirst ( ) ; Class c = p . getRight ( ) ; boolean found = false ; for ( Class < ? > c2 : REGISTERABLE_CUSTOM_CLASSES ) { if ( c2 . isAssignableFrom ( c ) ) { if ( c2 == Layer . class ) { LegacyLayerDeserializer . registerLegacyClassSpecifiedName ( s , ( Class < ? extends Layer > ) c ) ; } else if ( c2 == GraphVertex . class ) { LegacyGraphVertexDeserializer . registerLegacyClassSpecifiedName ( s , ( Class < ? extends GraphVertex > ) c ) ; } else if ( c2 == InputPreProcessor . class ) { LegacyPreprocessorDeserializer . registerLegacyClassSpecifiedName ( s , ( Class < ? extends InputPreProcessor > ) c ) ; } else if ( c2 == IActivation . class ) { LegacyIActivationDeserializer . registerLegacyClassSpecifiedName ( s , ( Class < ? extends IActivation > ) c ) ; } else if ( c2 == ILossFunction . class ) { LegacyILossFunctionDeserializer . registerLegacyClassSpecifiedName ( s , ( Class < ? extends ILossFunction > ) c ) ; } else if ( c2 == ReconstructionDistribution . class ) { LegacyReconstructionDistributionDeserializer . registerLegacyClassSpecifiedName ( s , ( Class < ? extends ReconstructionDistribution > ) c ) ; } found = true ; } } if ( ! found ) { throw new IllegalArgumentException ( "Cannot register class for legacy JSON deserialization: class " + c . getName ( ) + " is not a subtype of classes " + REGISTERABLE_CUSTOM_CLASSES ) ; } } }
Register a set of classes (Layer, GraphVertex, InputPreProcessor, IActivation, ILossFunction, ReconstructionDistribution
ONLY) for JSON deserialization, with custom names.<br>
Using this method directly should never be required (instead: use {@link #registerLegacyCustomClassesForJSON(Class[])}
but is added in case it is required in non-standard circumstances.