Closed hushunjian closed 2 years ago
@Mapping(target = "id", source = "id", defaultValue = "") Tree toTree(String id, String name, String parentId, String parentFullName, String parentFullId, Integer orderNum, String path, Integer level); @Override public Tree toTree(String id, String name, String parentId, String parentFullName, String parentFullId, Integer orderNum, String path, Integer level) { if ( id == null && name == null && parentId == null && parentFullName == null && parentFullId == null && orderNum == null && path == null && level == null ) { return null; } Tree tree = new Tree(); if ( id != null ) { if ( id != null ) { tree.setId( id ); } else { tree.setId( "" ); } } if ( name != null ) { tree.setName( name ); } if ( parentId != null ) { tree.setParentId( parentId ); } if ( parentFullName != null ) { tree.setParentFullName( parentFullName ); } if ( parentFullId != null ) { tree.setParentFullId( parentFullId ); } if ( orderNum != null ) { tree.setOrderNum( orderNum ); } if ( path != null ) { tree.setPath( path ); } if ( level != null ) { tree.setLevel( level ); } return tree; }
defaultValue is not working
Please use StackOverflow or GitHub Discussions for asking questions