protected final Optional < Integer > checkCustomInterval ( Metadata metadata , Status s ) { if ( customIntervals == null ) return Optional . empty ( ) ; for ( CustomInterval customInterval : customIntervals ) { String [ ] values = metadata . getValues ( customInterval . key ) ; if ( values == null ) { continue ; } for ( String v : values ) { if ( v . equals ( customInterval . value ) ) { return customInterval . getDurationForStatus ( s ) ; } } } return Optional . empty ( ) ; }
Returns the first matching custom interval