@Override public List<UserCredentialValueModel> getCredentialsDirectly() { List<CredentialEntity> credentials = new ArrayList<CredentialEntity>(user.getCredentials()); List<UserCredentialValueModel> result = new ArrayList<UserCredentialValueModel>(); if (credentials != null) { for (CredentialEntity credEntity : credentials) { UserCredentialValueModel credModel = new UserCredentialValueModel(); credModel.setType(credEntity.getType()); credModel.setDevice(credEntity.getDevice()); credModel.setValue(credEntity.getValue()); credModel.setSalt(credEntity.getSalt()); credModel.setHashIterations(credEntity.getHashIterations()); result.add(credModel); } } return result; }
@Override public List<UserCredentialValueModel> getCredentialsDirectly() { List<CredentialEntity> credentials = new ArrayList<>(user.getCredentials()); List<UserCredentialValueModel> result = new ArrayList<>(); for (CredentialEntity credEntity : credentials) { UserCredentialValueModel credModel = new UserCredentialValueModel(); credModel.setType(credEntity.getType()); credModel.setDevice(credEntity.getDevice()); credModel.setValue(credEntity.getValue()); credModel.setCreatedDate(credEntity.getCreatedDate()); credModel.setSalt(credEntity.getSalt()); credModel.setHashIterations(credEntity.getHashIterations()); credModel.setCounter(credEntity.getCounter()); credModel.setAlgorithm(credEntity.getAlgorithm()); credModel.setDigits(credEntity.getDigits()); credModel.setPeriod(credEntity.getPeriod()); result.add(credModel); } return result; }