// Path: core/domain/src/main/java/org/hesperides/core/domain/technos/entities/Techno.java
// @Value
// @EqualsAndHashCode(callSuper = true)
// public class Techno extends TemplateContainer {
// 
//     public Techno(TemplateContainer.Key key, List<Template> templates) {
//         super(key, templates);
//     }
// 
//     public static List<String> getTemplatesName(List<Techno> technos) {
//         return Optional.ofNullable(technos)
//                 .orElseGet(Collections::emptyList)
//                 .stream()
//                 .map(TemplateContainer::getTemplatesName)
//                 .flatMap(List::stream)
//                 .collect(Collectors.toList());
//     }
// 
//     public static class Key extends TemplateContainer.Key {
// 
//         private static final String URI_PREFIX = "/templates/packages";
//         private static final String NAMESPACE_PREFIX = "packages";
//         private static final String TOSTRING_PREFIX = "techno";
// 
//         public Key(String name, String version, VersionType versionType) {
//             super(name, version, versionType);
//         }
// 
//         public Key(TemplateContainerKeyView key) {
//             super(key.getName(), key.getVersion(), TemplateContainer.getVersionType(key.getIsWorkingCopy()));
//         }
// 
//         public static List<Key> fromViews(List<TemplateContainerKeyView> keys) {
//             return Optional.ofNullable(keys)
//                     .orElse(Collections.emptyList())
//                     .stream()
//                     .map(Key::new)
//                     .collect(Collectors.toList());
//         }
// 
//         @Override
//         protected String getUriPrefix() {
//             return URI_PREFIX;
//         }
// 
//         @Override
//         protected String getNamespacePrefix() {
//             return NAMESPACE_PREFIX;
//         }
// 
//         public String toString() {
//             return TOSTRING_PREFIX + super.toString();
//         }
//     }
// }


import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import static org.hesperides.core.infrastructure.mongo.Collections.TECHNO;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hesperides.core.domain.technos.entities.Techno;
import org.hesperides.core.domain.technos.queries.TechnoView;
import org.hesperides.core.domain.templatecontainers.entities.AbstractProperty;
import org.hesperides.core.domain.templatecontainers.entities.Template;
import org.hesperides.core.domain.templatecontainers.entities.TemplateContainer;
import org.hesperides.core.infrastructure.mongo.templatecontainers.AbstractPropertyDocument;
import org.hesperides.core.infrastructure.mongo.templatecontainers.KeyDocument;
import org.hesperides.core.infrastructure.mongo.templatecontainers.TemplateDocument;
/*
 *
 * This file is part of the Hesperides distribution.
 * (https://github.com/voyages-sncf-technologies/hesperides)
 * Copyright (c) 2016 VSCT.
 *
 * Hesperides is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, version 3.
 *
 * Hesperides is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 */
package org.hesperides.core.infrastructure.mongo.technos;




@Data
@Document(collection = TECHNO)
@NoArgsConstructor
public class TechnoDocument {
    @Id
    private String id;
    private KeyDocument key;
    private List<TemplateDocument> templates;
    private List<AbstractPropertyDocument> properties;

// Path: core/domain/src/main/java/org/hesperides/core/domain/technos/entities/Techno.java
// @Value
// @EqualsAndHashCode(callSuper = true)
// public class Techno extends TemplateContainer {
// 
//     public Techno(TemplateContainer.Key key, List<Template> templates) {
//         super(key, templates);
//     }
// 
//     public static List<String> getTemplatesName(List<Techno> technos) {
//         return Optional.ofNullable(technos)
//                 .orElseGet(Collections::emptyList)
//                 .stream()
//                 .map(TemplateContainer::getTemplatesName)
//                 .flatMap(List::stream)
//                 .collect(Collectors.toList());
//     }
// 
//     public static class Key extends TemplateContainer.Key {
// 
//         private static final String URI_PREFIX = "/templates/packages";
//         private static final String NAMESPACE_PREFIX = "packages";
//         private static final String TOSTRING_PREFIX = "techno";
// 
//         public Key(String name, String version, VersionType versionType) {
//             super(name, version, versionType);
//         }
// 
//         public Key(TemplateContainerKeyView key) {
//             super(key.getName(), key.getVersion(), TemplateContainer.getVersionType(key.getIsWorkingCopy()));
//         }
// 
//         public static List<Key> fromViews(List<TemplateContainerKeyView> keys) {
//             return Optional.ofNullable(keys)
//                     .orElse(Collections.emptyList())
//                     .stream()
//                     .map(Key::new)
//                     .collect(Collectors.toList());
//         }
// 
//         @Override
//         protected String getUriPrefix() {
//             return URI_PREFIX;
//         }
// 
//         @Override
//         protected String getNamespacePrefix() {
//             return NAMESPACE_PREFIX;
//         }
// 
//         public String toString() {
//             return TOSTRING_PREFIX + super.toString();
//         }
//     }
// }


// Path: core/infrastructure/src/main/java/org/hesperides/core/infrastructure/mongo/technos/TechnoDocument.java
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import static org.hesperides.core.infrastructure.mongo.Collections.TECHNO;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hesperides.core.domain.technos.entities.Techno;
import org.hesperides.core.domain.technos.queries.TechnoView;
import org.hesperides.core.domain.templatecontainers.entities.AbstractProperty;
import org.hesperides.core.domain.templatecontainers.entities.Template;
import org.hesperides.core.domain.templatecontainers.entities.TemplateContainer;
import org.hesperides.core.infrastructure.mongo.templatecontainers.AbstractPropertyDocument;
import org.hesperides.core.infrastructure.mongo.templatecontainers.KeyDocument;
import org.hesperides.core.infrastructure.mongo.templatecontainers.TemplateDocument;

/*
 *
 * This file is part of the Hesperides distribution.
 * (https://github.com/voyages-sncf-technologies/hesperides)
 * Copyright (c) 2016 VSCT.
 *
 * Hesperides is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, version 3.
 *
 * Hesperides is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 */
package org.hesperides.core.infrastructure.mongo.technos;




@Data
@Document(collection = TECHNO)
@NoArgsConstructor
public class TechnoDocument {
    @Id
    private String id;
    private KeyDocument key;
    private List<TemplateDocument> templates;
    private List<AbstractPropertyDocument> properties;

    TechnoDocument(String id, Techno techno) {