public Optional<String> getName() {
        if (name == null) {
            return Optional.empty();
        } else {
            return Optional.of(name);
        }
    }
public Optional<String> getName() {
        if (name == null) {
            return Optional.empty();
        } else {
            return Optional.of(name);
        }
    }
public Optional < String > getName ( ) { if ( name == null ) { return Optional . empty ( ) ; } else { return Optional . of ( name ) ; } }
gets the name (optional)
<p>
playlist doesn't need to have a name
</p>
@return the optional name
gets the name ( optional ) <p > playlist doesn t need to have a name < / p >