1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.core.technical
21 
22 import org.make.core.EventId
23 
24 import java.util.UUID
25 import org.make.core.auth.ClientId
26 import org.make.core.crmTemplate.CrmQuestionTemplateId
27 import org.make.core.demographics.DemographicsCardId
28 import org.make.core.feature.{ActiveFeatureId, FeatureId}
29 import org.make.core.idea.IdeaId
30 import org.make.core.job.Job.JobId
31 import org.make.core.operation.OperationId
32 import org.make.core.partner.PartnerId
33 import org.make.core.personality.{PersonalityId, PersonalityRoleFieldId, PersonalityRoleId}
34 import org.make.core.proposal.ProposalId
35 import org.make.core.question.QuestionId
36 import org.make.core.sequence.{ExplorationSequenceConfigurationId, SpecificSequenceConfigurationId}
37 import org.make.core.session.{SessionId, VisitorId}
38 import org.make.core.tag.{TagId, TagTypeId}
39 import org.make.core.user.UserId
40 import org.make.core.widget.{SourceId, WidgetId}
41 
42 trait IdGenerator {
43 
44   def nextClientId(): ClientId = ClientId(nextId())
45   def nextCrmQuestionTemplateId(): CrmQuestionTemplateId = CrmQuestionTemplateId(nextId())
46   def nextDemographicsCardId(): DemographicsCardId = DemographicsCardId(nextId())
47   def nextFeatureId(): FeatureId = FeatureId(nextId())
48   def nextActiveFeatureId(): ActiveFeatureId = ActiveFeatureId(nextId())
49   def nextIdeaId(): IdeaId = IdeaId(nextId())
50   def nextJobId(): JobId = JobId(nextId())
51   def nextOperationId(): OperationId = OperationId(nextId())
52   def nextPartnerId(): PartnerId = PartnerId(nextId())
53   def nextProposalId(): ProposalId = ProposalId(nextId())
54   def nextQuestionId(): QuestionId = QuestionId(nextId())
55   def nextTagId(): TagId = TagId(nextId())
56   def nextTagTypeId(): TagTypeId = TagTypeId(nextId())
57   def nextUserId(): UserId = UserId(nextId())
58   def nextVisitorId(): VisitorId = VisitorId(nextId())
59   def nextPersonalityId(): PersonalityId = PersonalityId(nextId())
60   def nextPersonalityRoleId(): PersonalityRoleId = PersonalityRoleId(nextId())
61   def nextPersonalityRoleFieldId(): PersonalityRoleFieldId = PersonalityRoleFieldId(nextId())
62   def nextSessionId(): SessionId = SessionId(nextId())
63   def nextEventId(): EventId = EventId(nextId())
64   def nextSpecificSequenceConfigurationId(): SpecificSequenceConfigurationId = SpecificSequenceConfigurationId(nextId())
65   def nextExplorationSequenceConfigurationId(): ExplorationSequenceConfigurationId =
66     ExplorationSequenceConfigurationId(nextId())
67   def nextSourceId(): SourceId = SourceId(nextId())
68   def nextWidgetId(): WidgetId = WidgetId(nextId())
69 
70   def nextId(): String
71 }
72 
73 object IdGenerator {
74   val uuidGenerator: IdGenerator = () => {
75     UUID.randomUUID().toString
76   }
77 }
Line Stmt Id Pos Tree Symbol Tests Code
44 4120 1697 - 1705 Apply org.make.core.technical.IdGenerator.nextId org.make.api.technical.auth.clientservicetest IdGenerator.this.nextId()
44 3347 1688 - 1706 Apply org.make.core.auth.ClientId.apply org.make.api.technical.auth.clientservicetest org.make.core.auth.ClientId.apply(IdGenerator.this.nextId())
45 4399 1766 - 1797 Apply org.make.core.crmTemplate.CrmQuestionTemplateId.apply org.make.core.crmTemplate.CrmQuestionTemplateId.apply(IdGenerator.this.nextId())
45 1365 1788 - 1796 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
46 690 1851 - 1879 Apply org.make.core.demographics.DemographicsCardId.apply org.make.core.demographics.DemographicsCardId.apply(IdGenerator.this.nextId())
46 2417 1870 - 1878 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
47 2882 1915 - 1934 Apply org.make.core.feature.FeatureId.apply org.make.api.feature.featureservicetest org.make.core.feature.FeatureId.apply(IdGenerator.this.nextId())
47 4985 1925 - 1933 Apply org.make.core.technical.IdGenerator.nextId org.make.api.feature.featureservicetest IdGenerator.this.nextId()
48 4320 1982 - 2007 Apply org.make.core.feature.ActiveFeatureId.apply org.make.core.feature.ActiveFeatureId.apply(IdGenerator.this.nextId())
48 781 1998 - 2006 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
49 1373 2037 - 2053 Apply org.make.core.idea.IdeaId.apply org.make.core.idea.IdeaId.apply(IdGenerator.this.nextId())
49 2345 2044 - 2052 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
50 4530 2087 - 2095 Apply org.make.core.technical.IdGenerator.nextId org.make.api.technical.job.jobactortest IdGenerator.this.nextId()
50 2426 2081 - 2096 Apply org.make.core.job.Job.JobId.apply org.make.api.technical.job.jobactortest org.make.core.job.Job.JobId.apply(IdGenerator.this.nextId())
51 4922 2136 - 2157 Apply org.make.core.operation.OperationId.apply org.make.core.operation.operationofquestiontest org.make.core.operation.OperationId.apply(IdGenerator.this.nextId())
51 700 2148 - 2156 Apply org.make.core.technical.IdGenerator.nextId org.make.core.operation.operationofquestiontest IdGenerator.this.nextId()
52 2894 2203 - 2211 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
52 902 2193 - 2212 Apply org.make.core.partner.PartnerId.apply org.make.core.partner.PartnerId.apply(IdGenerator.this.nextId())
53 4251 2261 - 2269 Apply org.make.core.technical.IdGenerator.nextId org.scalatest.testsuite,org.make.api.sessionhistory.sessionhistorycoordinatortest IdGenerator.this.nextId()
53 2354 2250 - 2270 Apply org.make.core.proposal.ProposalId.apply org.scalatest.testsuite,org.make.api.sessionhistory.sessionhistorycoordinatortest org.make.core.proposal.ProposalId.apply(IdGenerator.this.nextId())
54 4539 2308 - 2328 Apply org.make.core.question.QuestionId.apply org.make.core.operation.operationofquestiontest org.make.core.question.QuestionId.apply(IdGenerator.this.nextId())
54 1158 2319 - 2327 Apply org.make.core.technical.IdGenerator.nextId org.make.core.operation.operationofquestiontest IdGenerator.this.nextId()
55 629 2356 - 2371 Apply org.make.core.tag.TagId.apply org.make.api.tag.tagservicetest org.make.core.tag.TagId.apply(IdGenerator.this.nextId())
55 2476 2362 - 2370 Apply org.make.core.technical.IdGenerator.nextId org.make.api.tag.tagservicetest IdGenerator.this.nextId()
56 4007 2417 - 2425 Apply org.make.core.technical.IdGenerator.nextId org.make.api.tagtype.tagtypeservicetest IdGenerator.this.nextId()
56 2815 2407 - 2426 Apply org.make.core.tag.TagTypeId.apply org.make.api.tagtype.tagtypeservicetest org.make.core.tag.TagTypeId.apply(IdGenerator.this.nextId())
57 4116 2456 - 2472 Apply org.make.core.user.UserId.apply org.make.api.userhistory.userhistorycoordinatortest,org.scalatest.testsuite org.make.core.user.UserId.apply(IdGenerator.this.nextId())
57 910 2463 - 2471 Apply org.make.core.technical.IdGenerator.nextId org.make.api.userhistory.userhistorycoordinatortest,org.scalatest.testsuite IdGenerator.this.nextId()
58 2290 2518 - 2526 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
58 1170 2508 - 2527 Apply org.make.core.session.VisitorId.apply org.make.core.session.VisitorId.apply(IdGenerator.this.nextId())
59 4472 2585 - 2593 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
59 2413 2571 - 2594 Apply org.make.core.personality.PersonalityId.apply org.make.core.personality.PersonalityId.apply(IdGenerator.this.nextId())
60 3803 2646 - 2673 Apply org.make.core.personality.PersonalityRoleId.apply org.make.core.personality.PersonalityRoleId.apply(IdGenerator.this.nextId())
60 474 2664 - 2672 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
61 777 2735 - 2767 Apply org.make.core.personality.PersonalityRoleFieldId.apply org.make.core.personality.PersonalityRoleFieldId.apply(IdGenerator.this.nextId())
61 2829 2758 - 2766 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
62 2129 2803 - 2822 Apply org.make.core.session.SessionId.apply org.scalatest.testsuite org.make.core.session.SessionId.apply(IdGenerator.this.nextId())
62 4062 2813 - 2821 Apply org.make.core.technical.IdGenerator.nextId org.scalatest.testsuite IdGenerator.this.nextId()
63 4482 2854 - 2871 Apply org.make.core.EventId.apply org.make.core.EventId.apply(IdGenerator.this.nextId())
63 1104 2862 - 2870 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
64 2421 2983 - 2991 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
64 425 2951 - 2992 Apply org.make.core.sequence.SpecificSequenceConfigurationId.apply org.make.core.sequence.SpecificSequenceConfigurationId.apply(IdGenerator.this.nextId())
66 2839 3082 - 3126 Apply org.make.core.sequence.ExplorationSequenceConfigurationId.apply org.make.core.sequence.ExplorationSequenceConfigurationId.apply(IdGenerator.this.nextId())
66 3996 3117 - 3125 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
67 1039 3169 - 3177 Apply org.make.core.technical.IdGenerator.nextId IdGenerator.this.nextId()
67 4071 3160 - 3178 Apply org.make.core.widget.SourceId.apply org.make.core.widget.SourceId.apply(IdGenerator.this.nextId())
68 2275 3221 - 3229 Apply org.make.core.technical.IdGenerator.nextId org.make.api.widget.widgetservicetest IdGenerator.this.nextId()
68 5625 3212 - 3230 Apply org.make.core.widget.WidgetId.apply org.make.api.widget.widgetservicetest org.make.core.widget.WidgetId.apply(IdGenerator.this.nextId())
75 4494 3326 - 3352 Apply java.util.UUID.toString org.make.core.operation.operationofquestiontest,org.scalatest.testsuite,org.make.api.sessionhistory.sessionhistorycoordinatortest,org.make.api.feature.featureservicetest java.util.UUID.randomUUID().toString()